Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mybash dependencies #751

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 28 additions & 13 deletions core/tabs/applications-setup/mybash-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,33 @@

gitpath="$HOME/.local/share/mybash"

installDepend() {
if ! command_exists bash bash-completion tar bat tree unzip fontconfig git; then
printf "%b\n" "${YELLOW}Installing Bash...${RC}"
case "$PACKAGER" in
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig git
;;
*)
"$ESCALATION_TOOL" "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git
;;
esac
fi
installDeps() {
DEPS="bash bash-completion tar bat tree unzip fontconfig git"

# no way to reliably test for bash-completion for all I know
# fontconfig isn't an executable, so use fc-cache to test for installation
DEP_TESTS="bash tar bat tree unzip fc-cache git"

for dep in $DEP_TESTS; do
if ! command_exists "${dep}"; then
printf "%b\n" "${RED}Some dependencies weren't installed\n${GREEN}Installing${RC} [$(echo "${DEPS}" | sed 's/ /, /g')]"

case "$PACKAGER" in
pacman)
# disable globbing/word-splitting warning, need word splitting
# shellcheck disable=SC2086
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm $DEPS
;;
*)
# disable globbing/word-splitting warning, need word splitting
# shellcheck disable=SC2086
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPS
;;
esac

break
fi
done
cartercanedy marked this conversation as resolved.
Show resolved Hide resolved
cartercanedy marked this conversation as resolved.
Show resolved Hide resolved
}

cloneMyBash() {
Expand Down Expand Up @@ -102,7 +117,7 @@ linkConfig() {

checkEnv
checkEscalationTool
installDepend
installDeps
cartercanedy marked this conversation as resolved.
Show resolved Hide resolved
cloneMyBash
installFont
installStarshipAndFzf
Expand Down