code.sh 820 Bytes
Newer Older
1
#!/bin/sh
2 3

PKGNAME=code
4
SUPPORTEDARCHES="x86_64 armhf aarch64"
5
VERSION="$2"
6
DESCRIPTION="Visual Studio Code from the official site"
7
TIPS="Run epm play code=<version> to install specific version."
8

9
. $(dirname $0)/common.sh
10

11
arch="$(epm print info -a)"
12 13 14 15 16 17 18 19 20 21 22 23 24 25
case "$arch" in
    x86_64)
        arch=x64
        ;;
    armhf)
        ;;
    aarch64)
        arch=arm64
        ;;
    *)
        fatal "$arch arch is not supported"
        ;;
esac

26

27
pkgtype="$(epm print info -p)"
28

29
if [ "$VERSION" != "*" ] ; then
30
    PKGURL="https://update.code.visualstudio.com/$VERSION/linux-$pkgtype-$arch/stable"
31
else
32
    PKGURL="https://code.visualstudio.com/sha/download?build=stable&os=linux-$pkgtype-$arch"
33
fi
34

35
install_pkgurl
36 37

echo
Vitaly Lipatov's avatar
Vitaly Lipatov committed
38
echo "NOTE: VS Code is a proprietary build. We recommend you to use open source editors: Codium, Atom."