This commit is contained in:
2026-07-10 15:11:51 +08:00
parent 8bfcf23bc2
commit da17239d7d
148 changed files with 2542 additions and 4873 deletions
+36 -7
View File
@@ -1,18 +1,47 @@
#!/usr/bin/env bash
##makedesc: VSCode deb-package
source "$( dirname $(readlink -e -- "${BASH_SOURCE}"))/../helpers.sh" || exit 255
title
set -eo pipefail
mkdir -p "$HOME/install"
installed() { command -v "$1" >/dev/null 2>&1; }
download "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64" \
"$HOME/install/vscode.deb" && \
download() {
if installed wget; then
wget -q --show-progress "$1" -O "$2"
else
curl -fsSL "$1" -o "$2"
fi
}
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install --cask visual-studio-code
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing VSCode"
echo "==============================================="
echo
mkdir -p "$HOME/install"
download "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64" \
"$HOME/install/vscode.deb"
sudo dpkg -i "$HOME/install/vscode.deb"
[ $? = 0 ] && {
echo
success "VSCode installed"
echo "Finish!"
code --version
echo
}
case "$1" in
*) install ;;
esac