diff --git a/dot_bin/executable_bootstrap_pkgs b/dot_bin/executable_bootstrap_pkgs index d34838d..04dc1cc 100644 --- a/dot_bin/executable_bootstrap_pkgs +++ b/dot_bin/executable_bootstrap_pkgs @@ -12,6 +12,13 @@ # permissions in sudoers. pkgsrc_dir="$1" + +if [[ -z "${2+set}" ]]; then + install_root="$HOME" +else + install_root="$2" +fi + makepkg_tmp=/tmp/bootstrap-makepkg mk_makepkg_dir() { @@ -34,8 +41,8 @@ call_makepkg() { } run_install_scripts() { - ~/.config/rofi-extras/install_deps - ~/.config/xmonad/install_deps + "$install_root/.config/rofi-extras/install_deps" + "$install_root/.config/xmonad/install_deps" } run_yay() { @@ -57,8 +64,7 @@ run_yay() { ## AUR pkgs needed for spotify spotify_pkgs=(gconf) - MAKEFLAGS="-j$(nproc)" \ - yay --needed --noconfirm --norebuild --removemake -S \ + yay --needed --noconfirm --norebuild --removemake -S \ "${dunst_pkgs[@]}" \ "${emacs_pkgs[@]}" \ "${gtk_pkgs[@]}" \ @@ -92,12 +98,14 @@ clean_up() { trap 'clean_up' ERR if [ "$#" -ne 1 ]; then - echo "Usage: bootstrap_pkgs [CUSTOM_PKGBUILD_SRC]" + echo "Usage: bootstrap_pkgs CUSTOM_PKGBUILD_SRC [INSTALL_ROOT]" exit 1 fi try_update +run_install_scripts + run_yay mk_makepkg_dir