Last active
August 27, 2024 17:55
-
-
Save thatrandomperson5/231ab631fa3f46152a2db92910d38d4b to your computer and use it in GitHub Desktop.
VSCode Linux CLI install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Installing VSCode CLI in $PREFIX/bin" | |
ARCHITECTURE=$(lscpu | grep "Architecture" | tr -d " \t\n\r" | cut -c 14-) # Extract the architecture | |
URL="" | |
TAR_LOCATION="$PREFIX/bin/vscode.tar.gz" | |
if [ "$ARCHITECTURE" = "arm64" ] || [ "$ARCHITECTURE" = "aarch64" ]; then | |
URL="https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-arm64" | |
elif [ "$ARCHITECTURE" = "arm32" ]; then | |
URL="https://code.visualstudio.com/sha/download?build=stable&os=cli-linux-armhf" | |
elif [ "$ARCHITECTURE" = "x64" ] || [ "$ARCHITECTURE" = "x86_64" ] || [ "$ARCHITECTURE" = "amd64" ]; then | |
URL="https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64" | |
fi | |
echo "Downloading $URL" | |
curl -sSfL "$URL" -o "$TAR_LOCATION" | |
FILECOUNT=$(tar -tzf "$TAR_LOCATION" | wc -l) | |
if [ "$FILECOUNT" != "1" ]; then | |
exit 1 | |
fi | |
echo "Extracting $TAR_LOCATION" | |
tar -xzf "$TAR_LOCATION" -C "$PREFIX/bin" | |
rm "$TAR_LOCATION" | |
# Run: curl -sSfL https://gist.githubusercontent.com/thatrandomperson5/231ab631fa3f46152a2db92910d38d4b/raw/install.sh | sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment