From 347bdffbde23fd4c0fc619f95c2c697a702e3a3f Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Sat, 28 Mar 2020 04:58:36 +0100 Subject: Please shellcheck --- lib/main.bash | 14 +++++++++++++- lib/util.bash | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/main.bash b/lib/main.bash index 440cda5..8b399e1 100644 --- a/lib/main.bash +++ b/lib/main.bash @@ -1,6 +1,9 @@ #!/usr/bin/env bash +# shellcheck source=lib/util.bash source "$(dirname "${BASH_SOURCE[0]}")/util.bash" + +# shellcheck source=lib/logging.bash source "$(dirname "${BASH_SOURCE[0]}")/logging.bash" main() { @@ -32,6 +35,12 @@ main() { debug "Discovering system information" discover_system + # Export RSTAR_ variables + export RSTAR_TOOLS + export RSTAR_BACKEND + export RSTAR_PREFIX + export RSTAR_PLATFORM + # Source the file defining the action. debug "Sourcing $action_path" source "$action_path" @@ -122,18 +131,21 @@ depcheck_bin() { then local packages local pacman_cmd + local package debug "bindep_db found" # Create a list of packages that needs to be installed for tool in "${missing[@]}" do - local package="$(config_etc_kv "$bindep_db" "$tool")" + package="$(config_etc_kv "$bindep_db" "$tool")" # Don't add duplicates in_args "$package" "${packages[@]}" && continue packages+=("$package") + + unset package done # Figure out which package manager command install on diff --git a/lib/util.bash b/lib/util.bash index eb7c9a8..92ff1bc 100644 --- a/lib/util.bash +++ b/lib/util.bash @@ -101,7 +101,7 @@ in_args() { for arg in "$@" do - [[ $needle == $arg ]] && return 0 + [[ $needle == "$arg" ]] && return 0 done return 1 -- cgit v1.1