Coder Social home page Coder Social logo

vscode.sh's Introduction

vscode.sh

script for installing vscode from tarball (tar.gz), can be used for updating as well how to use?

bash vscode.sh

vscode.sh

#!/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

vscode.sh's People

Contributors

beangreen247 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.