From 7de9b4cd92885d0358f38bd99269c117b561e7e4 Mon Sep 17 00:00:00 2001 From: AyushSehrawat Date: Wed, 19 Apr 2023 14:14:44 +0530 Subject: [PATCH] feat: fixed update only for amd64 for now refactor: removed useless conditional checks --- neurons/discord.sh | 7 +------ neurons/edge.sh | 27 ++++++++++++--------------- neurons/golang.sh | 6 +----- neurons/vscode.sh | 6 +----- 4 files changed, 15 insertions(+), 31 deletions(-) diff --git a/neurons/discord.sh b/neurons/discord.sh index 941e753..052f6a4 100755 --- a/neurons/discord.sh +++ b/neurons/discord.sh @@ -37,16 +37,11 @@ update() { } if [[ $1 =~ (-install) ]]; then - # check if current version is 0.0.0 ( which means not installed ) if [[ "$CURRENT_VERSION" == "0.0.0" ]]; then echo "Installing Discord..." unpack else - echo "Discord is already installed ($CURRENT_VERSION)." - read -r -p "Do you want to update discord? (y/n) " answer - if [[ $answer =~ ^([yY][eE][sS]|[yY])$ ]]; then - update - fi + echo "Discord is already installed ($CURRENT_VERSION). If you want to update use brain update ." fi echo "Downloading Discord $LATEST_VERSION..." unpack diff --git a/neurons/edge.sh b/neurons/edge.sh index 97304a3..a364a29 100644 --- a/neurons/edge.sh +++ b/neurons/edge.sh @@ -1,7 +1,6 @@ #!/bin/bash ARCH=$(uname -m) -PACKAGE_MANAGER= PACKAGE_MANAGER_UPDATE_CMD= PACKAGE_MANAGER_INSTALL_CMD= PACKAGE_MANAGER_UNINSTALL_CMD= @@ -9,13 +8,11 @@ PACKAGE_MANAGER_UNINSTALL_CMD= case "$ARCH" in x86_64 | amd64) if [ -x "$(command -v dpkg)" ]; then - PACKAGE_MANAGER="apt-get" PACKAGE_MANAGER_UPDATE_CMD="sudo dpkg -i ./microsoft-edge-stable_*.deb" PACKAGE_MANAGER_INSTALL_CMD="sudo dpkg -i ./microsoft-edge-stable_*.deb" PACKAGE_MANAGER_UNINSTALL_CMD="sudo apt remove microsoft-edge-stable" URL=$(curl -s https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/ | grep -o '" fi elif [[ $1 =~ (-update) ]]; then update diff --git a/neurons/vscode.sh b/neurons/vscode.sh index a0d7edb..bc6cacc 100755 --- a/neurons/vscode.sh +++ b/neurons/vscode.sh @@ -52,11 +52,7 @@ if [[ $1 =~ (-install) ]]; then echo "Installing Visual Studio Code..." unpack else - echo "Visual Studio Code is already installed ($CURRENT_VERSION)." - read -r -p "Do you want to update Visual Studio Code? (y/n) " answer - if [[ $answer =~ ^([yY][eE][sS]|[yY])$ ]]; then - update - fi + echo "Visual Studio Code is already installed ($CURRENT_VERSION). If you want to update use brain update " fi elif [[ $1 =~ (-update) ]]; then update