diff options
Diffstat (limited to 'gohan.sh')
| -rwxr-xr-x | gohan.sh | 12 | 
1 files changed, 9 insertions, 3 deletions
@@ -127,7 +127,7 @@ install_dotfiles() {    install_from_repo "https://git.davidtsadler.com/dotfiles/" "custom dotfiles" "$srcdir"    [ -d "$srcdir/dotfiles" ] && ( -    chown -R "$name":"$name" "$srcdir" +    chown -R "$name":"$name" "/home/$name/.local"      cd "$srcdir/dotfiles"      sudo -u "$name" make clean install >/dev/null 2>&1    ) @@ -146,6 +146,7 @@ install_yay() {      echo "Installing yay ..."      # Use all cores for compilation.      sed -i "s/-j2/-j$(nproc)/;s/^#MAKEFLAGS/MAKEFLAGS/" /etc/makepkg.conf +      cd /tmp      rm -rf /tmp/yay      git clone https://aur.archlinux.org/yay.git @@ -159,7 +160,9 @@ install_yay() {  install_packages() {    curl -Ls https://git.davidtsadler.com/gohan/plain/packages.csv?h=version-1.0.0 > /tmp/packages.csv +    total=$(wc -l < /tmp/packages.csv) +    while IFS=, read -r tag program comment; do      n=$((n+1))      echo "$comment" | grep "^\".*\"$" >/dev/null 2>&1 && comment="$(echo "$comment" | sed "s/\(^\"\|\"$\)//g")" @@ -170,25 +173,28 @@ install_packages() {        *) install_package "$program" "$comment" ;;      esac    done < /tmp/packages.csv +    rm /tmp/packages.csv  }  install_package() {    printf  "Installing \`$1\` ($n of $total). $1 $2\n" +    install_from_pacman "$1"  }  install_from_aur() {    printf "Installing \`$1\` ($n of $total) from the AUR. $1 $2\n" +    sudo -u "$name" yay -S --noconfirm "$1" >/dev/null 2>&1  }  install_repo() { +  printf "Installing \`$progname\` ($n of $total) via \`git\` and \`make\`. $(basename "$1") $2\n" +    progname="$(basename "$1" .git)"    dir="$3/$progname" -  printf "Installing \`$progname\` ($n of $total) via \`git\` and \`make\`. $(basename "$1") $2\n" -    install_from_repo "$1" "$2" "$3"    [ -d "$dir" ] && (  | 
