Refactor
This commit is contained in:
parent
accb99b0dc
commit
4c6afc1b69
|
@ -30,8 +30,8 @@ checkParameters() {
|
||||||
setDialogBox "whiptail"
|
setDialogBox "whiptail"
|
||||||
setLogToFile true "$(pwd -P)"
|
setLogToFile true "$(pwd -P)"
|
||||||
;;
|
;;
|
||||||
-p | --packages)
|
-p | --packages)
|
||||||
runUserScripts=true
|
userScriptsFlag=true
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf '%s: invalid option %s\n' "${0##*/}" "$1"
|
printf '%s: invalid option %s\n' "${0##*/}" "$1"
|
||||||
|
@ -104,11 +104,8 @@ checkForDependencies() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
startRice() {
|
runUserScripts() {
|
||||||
displayDialogBox --title "sadedot" --msgbox "Hi! This script will auto install my dotfiles."
|
if [[ -n $userScriptsFlag && $userScriptsFlag = true ]]; then
|
||||||
getGitconfigData
|
|
||||||
source scripts/linkFiles.sh
|
|
||||||
if [[ -n $runUserScripts && $runUserScripts = true ]]; then
|
|
||||||
lastFolder=$(pwd -P)
|
lastFolder=$(pwd -P)
|
||||||
cd .. || { echo "Couldn't cd into parent folder." 1>&2 && exit 1; }
|
cd .. || { echo "Couldn't cd into parent folder." 1>&2 && exit 1; }
|
||||||
for script in $(find -H scripts -type f); do
|
for script in $(find -H scripts -type f); do
|
||||||
|
@ -116,6 +113,13 @@ startRice() {
|
||||||
done
|
done
|
||||||
cd "$lastFolder" || { echo "Couldn't cd into '$lastFolder'." 1>&2 && exit 1; }
|
cd "$lastFolder" || { echo "Couldn't cd into '$lastFolder'." 1>&2 && exit 1; }
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
startRice() {
|
||||||
|
displayDialogBox --title "sadedot" --msgbox "Hi! This script will auto install my dotfiles."
|
||||||
|
getGitconfigData
|
||||||
|
source scripts/linkFiles.sh
|
||||||
|
runUserScripts
|
||||||
displayDialogBox --title "sadedot" --msgbox "All done! Enjoy..."
|
displayDialogBox --title "sadedot" --msgbox "All done! Enjoy..."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue