Add a fallback function to the config.sh in case the stowing failed but

the module is required.
This commit is contained in:
Hans Goor 2024-09-01 21:25:42 +02:00
parent 413f560583
commit 3232beff25
Signed by: eyedevelop
SSH key fingerprint: SHA256:Td89veptDEwCV8J3fjqnknNk7SbwzedYhauyC2nFBYg
2 changed files with 14 additions and 0 deletions

View file

@ -44,6 +44,7 @@ install_stower() {
--dir "${STOWERS_DIR}" \
--target "${TARGET_DIR}" \
--ignore "config.sh" "${stower_name}" || \
{ [[ "$(type -t fallback)" == "function" ]] && fallback "${stower_dir}" "${TARGET_DIR}"; } || \
{ echo "[!] [${stower_name}] Failed to install!" >&2; return 1; }
echo "[+] [${stower_name}] Installed!"

View file

@ -1,3 +1,16 @@
#!/bin/bash
COMMAND_DEPS=("git")
fallback() {
local stower_dir target_dir
stower_dir="$1"
target_dir="$2"
git config --global user.name "Hans Goor"
git config --global user.email "me@eyedevelop.org"
git config --global commit.gpgSign true
git config --global push.autoSetupRemote true
git config --global init.defaultBranch main
git config --global pull.rebase true
}