diff options
| -rwxr-xr-x | public/thesiah-debian.sh | 20 | ||||
| -rwxr-xr-x | static/thesiah-debian.sh | 20 |
2 files changed, 32 insertions, 8 deletions
diff --git a/public/thesiah-debian.sh b/public/thesiah-debian.sh index 7aa7675..461f053 100755 --- a/public/thesiah-debian.sh +++ b/public/thesiah-debian.sh @@ -19,12 +19,16 @@ installpkg() { error() { whiptail --title "Error" --msgbox "An error occurred: $1" 8 78 + printf "%s\n" "$1" >&2 exit 1 } welcomemsg() { whiptail --title "Welcome!" \ --msgbox "Welcome to Soomin's Auto-Rice Bootstrapping Script for Debian! This script will automatically install a fully-featured Linux desktop, which I use as my main machine." 12 60 + whiptail --title "Important Note!" --yes-button "All ready!" \ + --no-button "Return..." \ + --yesno "Be sure the computer you are using has current pacman updates and refreshed Debian keyrings.\\n\\nIf it does not, the installation of some programs might fail." 8 70 } getuserandpass() { @@ -74,10 +78,13 @@ installationloop() { ([ -f "$progsfile" ] && cp "$progsfile" /tmp/progs.csv) || curl -Ls "$progsfile" | sed '/^#/d' >/tmp/progs.csv total=$(wc -l </tmp/progs.csv) while IFS=, read -r tag program comment; do + n=$((n + 1)) + echo "$comment" | grep -q "^\".*\"$" && + comment="$(echo "$comment" | sed -E "s/(^\"|\"$)//g")" case "$tag" in "G") gitmakeinstall "$program" "$comment" ;; - "P") pipinstall "$program" ;; - *) maininstall "$program" ;; + "P") pipinstall "$program" "$comment" ;; + *) maininstall "$program" "$comment" ;; esac done </tmp/progs.csv } @@ -150,7 +157,12 @@ lfinstall() { } zoxideinstall() { - git clone https://github.com/ajeetdsouza/zoxide.git + sudo -u "$name" git -C "/home/$name" clone --depth 1 --single-branch \ + --no-tags -q https://github.com/ajeetdsouza/zoxide.git zoxide || + { + cd zoxide || return 1 + sudo -u "$name" git pull --force origin master + } cd zoxide ./install.sh cd /tmp || return @@ -284,7 +296,7 @@ zoxideinstall || error "User exited." nviminstall || error "User exited." -putgitrepo "$dotfilesrepo" "/home/$name" "$repobranch" +putgitrepo "$dotfilesrepo" "/home/$name/.dotfiles" "$repobranch" rm -rf "/home/$name/.git/" "/home/$name/README.md" "/home/$name/LICENSE" "/home/$name/FUNDING.yml" cd "/home/$name/.dotfiles" && stow --no-folding -S debian && stow --no-folding -S default || exit 1 diff --git a/static/thesiah-debian.sh b/static/thesiah-debian.sh index 7aa7675..461f053 100755 --- a/static/thesiah-debian.sh +++ b/static/thesiah-debian.sh @@ -19,12 +19,16 @@ installpkg() { error() { whiptail --title "Error" --msgbox "An error occurred: $1" 8 78 + printf "%s\n" "$1" >&2 exit 1 } welcomemsg() { whiptail --title "Welcome!" \ --msgbox "Welcome to Soomin's Auto-Rice Bootstrapping Script for Debian! This script will automatically install a fully-featured Linux desktop, which I use as my main machine." 12 60 + whiptail --title "Important Note!" --yes-button "All ready!" \ + --no-button "Return..." \ + --yesno "Be sure the computer you are using has current pacman updates and refreshed Debian keyrings.\\n\\nIf it does not, the installation of some programs might fail." 8 70 } getuserandpass() { @@ -74,10 +78,13 @@ installationloop() { ([ -f "$progsfile" ] && cp "$progsfile" /tmp/progs.csv) || curl -Ls "$progsfile" | sed '/^#/d' >/tmp/progs.csv total=$(wc -l </tmp/progs.csv) while IFS=, read -r tag program comment; do + n=$((n + 1)) + echo "$comment" | grep -q "^\".*\"$" && + comment="$(echo "$comment" | sed -E "s/(^\"|\"$)//g")" case "$tag" in "G") gitmakeinstall "$program" "$comment" ;; - "P") pipinstall "$program" ;; - *) maininstall "$program" ;; + "P") pipinstall "$program" "$comment" ;; + *) maininstall "$program" "$comment" ;; esac done </tmp/progs.csv } @@ -150,7 +157,12 @@ lfinstall() { } zoxideinstall() { - git clone https://github.com/ajeetdsouza/zoxide.git + sudo -u "$name" git -C "/home/$name" clone --depth 1 --single-branch \ + --no-tags -q https://github.com/ajeetdsouza/zoxide.git zoxide || + { + cd zoxide || return 1 + sudo -u "$name" git pull --force origin master + } cd zoxide ./install.sh cd /tmp || return @@ -284,7 +296,7 @@ zoxideinstall || error "User exited." nviminstall || error "User exited." -putgitrepo "$dotfilesrepo" "/home/$name" "$repobranch" +putgitrepo "$dotfilesrepo" "/home/$name/.dotfiles" "$repobranch" rm -rf "/home/$name/.git/" "/home/$name/README.md" "/home/$name/LICENSE" "/home/$name/FUNDING.yml" cd "/home/$name/.dotfiles" && stow --no-folding -S debian && stow --no-folding -S default || exit 1 |
