testing more robust run command
This commit is contained in:
parent
58b5f36246
commit
0043824506
1 changed files with 12 additions and 6 deletions
12
distros.sh
12
distros.sh
|
@ -154,16 +154,21 @@ source_script() {
|
|||
fi
|
||||
}
|
||||
|
||||
# just an alias for source_script
|
||||
source-script() {
|
||||
source_script "$1"
|
||||
}
|
||||
|
||||
run() {
|
||||
if [[ -z $silent ]]; then
|
||||
"$@"
|
||||
else
|
||||
if $silent; then
|
||||
silentexec "$@"
|
||||
else
|
||||
"$@"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# if given an array, it checks if the command is available, and if not - installs all packages in that array one by one
|
||||
|
@ -182,7 +187,8 @@ checkAndInstall() {
|
|||
fi
|
||||
else
|
||||
# ─< else go though the list of items and do the same >───────────────────────────────────
|
||||
echo_pkg deps "${BRIGHT_YELLOW}Installing ${RED}${#@}${BRIGHT_YELLOW} packages.. - ${BRIGHT_BLUE} $* ${NC}"
|
||||
echo_pkg deps "${BRIGHT_YELLOW}Installing ${RED}${#@}${BRIGHT_YELLOW} packages..${NC}"
|
||||
echo_pkg deps "${BRIGHT_BLUE} $* ${NC}"
|
||||
for deps in "${@}"; do
|
||||
# echo_pkg deps "Installing $deps"
|
||||
if ! command_exists $deps; then
|
||||
|
@ -192,7 +198,7 @@ checkAndInstall() {
|
|||
echo_pkg deps "$deps is already installed.."
|
||||
fi
|
||||
else
|
||||
echo_pkg deps "skipping $1 - as it's ${RED}already installed.."
|
||||
echo_pkg deps "skipping $deps - as it's ${RED}already installed.."
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
@ -573,7 +579,7 @@ if check_env; then
|
|||
touch "$pikaCheckFile"
|
||||
fi
|
||||
else
|
||||
echo_note "Skipping repo refresh (PIKA_INIT is already set)"
|
||||
echo_pkg "Skipping repo refresh (PIKA_INIT is already set)"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue