37 lines
851 B
Bash
37 lines
851 B
Bash
#!/usr/bin/env bash
|
|
|
|
cloneAndMake() {
|
|
if [ -z "$password" ]; then
|
|
read -s -p "Enter your password: " password
|
|
echo
|
|
fi
|
|
|
|
echo "Downloading '${1}'"
|
|
git clone "$2"
|
|
|
|
if [ -e "$1/Makefile" ]; then
|
|
(cd "$1" || { echo "Couldn't cd into '$1'." 1>&2 && exit 1; }; echo "$password" | sudo make install)
|
|
fi
|
|
}
|
|
|
|
downloadAndInstallPackages() {
|
|
DOTFILES_CONFIG="$HOME/.config"
|
|
cd "$DOTFILES_CONFIG" || { echo "Couldn't cd into '$DOTFILES_CONFIG'." 1>&2 && exit 1; }
|
|
repositories=(
|
|
"https://gitlab.com/slococo/cbattery.git"
|
|
"https://gitlab.com/slococo/clauncher.git"
|
|
"https://gitlab.com/slococo/sketchybar.git"
|
|
)
|
|
|
|
for url in "${repositories[@]}"; do
|
|
name=$(basename "$url" .git)
|
|
cloneAndMake "$name" "$url"
|
|
done
|
|
}
|
|
|
|
runScript() {
|
|
downloadAndInstallPackages
|
|
}
|
|
|
|
runScript
|