From 78c91dceba3ffd8c54fccc650d9236739464a897 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Wed, 19 Jul 2023 15:53:06 +0200 Subject: [PATCH] fix shellcheck issues (#55) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### :book: Summary - fix shelchek issues in arkanum bash script #### :bookmark_tabs: Test Plan > :bulb: Select your test plan for the code changes. | Choice | Test Method | | :----: | :----------- | | ✅ | CI pipeline tests | | | Custom test | | | No test plan | ##### Details / Justification #### :books: Additional Notes Co-authored-by: OCram85 Reviewed-on: https://gitea.ocram85.com/CodeServer/arkanum/pulls/55 --- arkanum | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arkanum b/arkanum index 5a52309..3768e12 100755 --- a/arkanum +++ b/arkanum @@ -67,6 +67,7 @@ function instDockerCLI() { sudo -E install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo -E gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo -E chmod a+r /etc/apt/keyrings/docker.gpg + # shellcheck disable=SC2046,SC2027 echo \ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ @@ -90,6 +91,7 @@ function instDotNet() { say "Installing latest .NET Core LTS release..." "dotnet" /tmp/dotnet-install.sh --channel LTS + # shellcheck disable=SC2016 echo 'export PATH=$PATH:/config/.dotnet' | sudo tee -a /etc/bash.bashrc > /dev/null say "Cleaning up..." "dotnet" @@ -113,6 +115,7 @@ function instGoLang() { say "Installing golang ($GOVERSION)...." "GoLang" sudo rm -rf /usr/local/go sudo tar -C /usr/local -xzf /tmp/golang.tar.gz + # shellcheck disable=SC2016 echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee -a /etc/bash.bashrc > /dev/null say "Cleaning up..." "GoLang" rm -f /tmp/golang.tar.gz @@ -244,7 +247,7 @@ function main() { exit 0 fi - for i in $@; do + for i in "$@"; do if [[ "$1" == "-h" ]]; then showHelp exit 0 @@ -253,7 +256,7 @@ function main() { elif [[ "$i" == "dotnet" ]]; then instDotNet elif [[ "$i" == "golang" ]]; then - instGoLang + instGoLang "$2" elif [[ "$i" == "nodejs" ]]; then if [[ "$2" == "--legacy" ]]; then sayW "Installing NodeJS with legacy function" "Arkanum" @@ -285,4 +288,4 @@ function main() { done } -main $@ +main "$@"