1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
PKGNAME=code
SUPPORTEDARCHES="x86_64 armhf aarch64"
DESCRIPTION="Visual Studio Code from the official site"
TIPS="Run epm play code <version> to install specific version."
. $(dirname $0)/common.sh
VERSION="$2"
arch="$($DISTRVENDOR -a)"
case "$arch" in
x86_64)
arch=x64
;;
armhf)
;;
aarch64)
arch=arm64
;;
*)
fatal "$arch arch is not supported"
;;
esac
pkgtype="$($DISTRVENDOR -p)"
# we have workaround for their postinstall script, so always repack rpm package
[ "$pkgtype" = "deb" ] || repack='--repack'
if [ -n "$VERSION" ] ; then
URL="https://update.code.visualstudio.com/$VERSION/linux-$pkgtype-$arch/stable"
else
URL="https://code.visualstudio.com/sha/download?build=stable&os=linux-$pkgtype-$arch"
fi
epm install $repack "$URL" || exit
echo
echo "NOTE: VS Code is a proprietary build. We recommend to use open source editors: Codium, Atom."