[ADD] Options for bootstrap script
This commit is contained in:
parent
78c8ab8481
commit
e602f46fba
29
bootstrap.sh
29
bootstrap.sh
|
@ -3,9 +3,28 @@
|
||||||
# Exit on errors
|
# Exit on errors
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
for arg; do
|
||||||
|
case "$arg" in
|
||||||
|
--no-creds)
|
||||||
|
NOCREDS=1
|
||||||
|
;;
|
||||||
|
--no-lang)
|
||||||
|
NOLANG=1
|
||||||
|
;;
|
||||||
|
--no-yay)
|
||||||
|
NOYAY=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown option '$arg'" >&2
|
||||||
|
echo "Usage: $0 [--no-creds] [--no-lang] [--no-yay]" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
# Install pre-requisite packages for installing packages and connecting
|
# Install pre-requisite packages for installing packages and connecting
|
||||||
prerequisite() {
|
prerequisite() {
|
||||||
sudo pacman -S base base-devel git stow mosh jq
|
sudo pacman -S --noconfirm base base-devel git stow mosh jq
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install the yay AUR helper
|
# Install the yay AUR helper
|
||||||
|
@ -53,7 +72,7 @@ get-ssh() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get-creds() {
|
get-creds() {
|
||||||
if [ -z ${BW_SESSION-set} ]; then
|
if [ -z "${BW_SESSION-set}" ]; then
|
||||||
BW_SESSION="$(bw login --raw)"
|
BW_SESSION="$(bw login --raw)"
|
||||||
export BW_SESSION
|
export BW_SESSION
|
||||||
fi
|
fi
|
||||||
|
@ -62,6 +81,6 @@ get-creds() {
|
||||||
}
|
}
|
||||||
|
|
||||||
prerequisite
|
prerequisite
|
||||||
install-yay
|
[ -z "$NOYAY" ] && install-yay
|
||||||
setup-lang
|
[ -z "$NOLANG" ] && setup-lang
|
||||||
get-creds
|
[ -z "$NOCREDS" ] && get-creds
|
||||||
|
|
Loading…
Reference in a new issue