Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/beangreen247/vscode.sh
script for installing vscode from tarball (tar.gz), can be used for updating as well
https://github.com/beangreen247/vscode.sh
247 bean beangreen beangreen247 code green gz install microsoft script studio tar tarball visual visual-studio visual-studio-code vscode
Last synced: 12 days ago
JSON representation
script for installing vscode from tarball (tar.gz), can be used for updating as well
- Host: GitHub
- URL: https://github.com/beangreen247/vscode.sh
- Owner: BeanGreen247
- Created: 2023-05-19T12:43:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-19T12:44:47.000Z (over 1 year ago)
- Last Synced: 2024-12-08T21:56:24.329Z (17 days ago)
- Topics: 247, bean, beangreen, beangreen247, code, green, gz, install, microsoft, script, studio, tar, tarball, visual, visual-studio, visual-studio-code, vscode
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vscode.sh
script for installing vscode from tarball (tar.gz), can be used for updating as well
how to use?
```bash
bash vscode.sh
```
vscode.sh
```bash
#!/bin/bash
#vars
echo -n "Enter root password: "
read -s password
pass="$password"
codeDLp1="$(curl -I --silent 'https://code.visualstudio.com/sha/download?build=stable&os=linux-x64' | grep 'location' | awk {'print $2'} | cut -d "/" -f 3 | cut -d "." -f 1)"
codeDLp2="$(curl -I --silent 'https://code.visualstudio.com/sha/download?build=stable&os=linux-x64' | grep 'location' | awk {'print $2'} | cut -d "/" -f 5)"
codeLatestVer="$(curl -I --silent 'https://code.visualstudio.com/sha/download?build=stable&os=linux-x64' | grep "location" | cut -d '/' -f 6 | cut -d '-' -f 4 | cut -d '.' -f 1)"cd $HOME/Downloads/
rm -rf vscode.tar.gz 2> /dev/null
echo "Latest version: "$codeLatestVer;
echo "Downloading..."
curl -# -L -o vscode.tar.gz https://$codeDLp1.vo.msecnd.net/stable/$codeDLp2/code-stable-x64-$codeLatestVer.tar.gz
echo "Installing..."
echo $pass | sudo -S tar -xvzf vscode.tar.gz -C /opt
echo $pass | sudo -S ln -sf /opt/VSCode-linux-x64/code /usr/bin/code
echo "[Desktop Entry]
Name=Visual Studio Code
Comment=Programming Text Editor
Exec=/usr/bin/code
Icon=/opt/VSCode-linux-x64/resources/app/resources/linux/code.png
Terminal=false
Type=Application
Categories=Programming;" | tee -a temp.vscode.desktop
echo $pass | sudo -S mv temp.vscode.desktop /opt/VSCode-linux-x64/code.desktop
echo $pass | sudo -S cp -r /opt/VSCode-linux-x64/code.desktop /usr/share/applications
echo "Cleanup..."
rm -rf vscode.tar.gz
cd $HOME
```