Commit 955a95f0 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play code: add version support (f.i. epm play code 1.42.1)

parent 0fb614f0
...@@ -5,6 +5,7 @@ DESCRIPTION="Visual Studio Code from the official site" ...@@ -5,6 +5,7 @@ DESCRIPTION="Visual Studio Code from the official site"
. $(dirname $0)/common.sh . $(dirname $0)/common.sh
VERSION="$2"
arch="$($DISTRVENDOR -a)" arch="$($DISTRVENDOR -a)"
case "$arch" in case "$arch" in
...@@ -28,8 +29,15 @@ pkgtype="$($DISTRVENDOR -p)" ...@@ -28,8 +29,15 @@ pkgtype="$($DISTRVENDOR -p)"
[ "$pkgtype" = "deb" ] || repack='--repack' [ "$pkgtype" = "deb" ] || repack='--repack'
PKG=/tmp/$PKGNAME.$pkgtype PKG=/tmp/$PKGNAME.$pkgtype
# TODO: wget does not support: Content-Disposition: attachment; filename="code-1.52.1-1608137084.el7.x86_64.rpm"
$EGET -O $PKG "https://code.visualstudio.com/sha/download?build=stable&os=linux-$pkgtype-$arch" || fatal if [ -n "$VERSION" ] ; then
# get the version
$EGET -O $PKG "https://update.code.visualstudio.com/$VERSION/linux-$pkgtype-$arch/stable" || fatal
else
# get latest version
# TODO: wget does not support: Content-Disposition: attachment; filename="code-1.52.1-1608137084.el7.x86_64.rpm"
$EGET -O $PKG "https://code.visualstudio.com/sha/download?build=stable&os=linux-$pkgtype-$arch" || fatal
fi
epm install $repack "$PKG" || exit epm install $repack "$PKG" || exit
rm -fv $PKG rm -fv $PKG
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment