From 2571cf92b907bc27d68be9f9436c4f5d72cfb353 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Fri, 2 Apr 2021 22:36:44 +0200 Subject: [PATCH] Split installpackages into root/nonroot --- script/installpackages | 15 +++++---------- script/installpackagesnonroot | 9 +++++++++ 2 files changed, 14 insertions(+), 10 deletions(-) create mode 100755 script/installpackagesnonroot diff --git a/script/installpackages b/script/installpackages index 02a454f..4c89d1e 100755 --- a/script/installpackages +++ b/script/installpackages @@ -1,13 +1,13 @@ #!/usr/bin/env bash # -# Install packages for a new Arch or Manjaro installation. Requires sudo +# install packages for a new arch or manjaro installation. requires sudo -if [[ $EUID > 0 ]]; then +if [[ $euid > 0 ]]; then echo "requires administrative privileges" exit 1 fi -pacman -S --needed --noconfirm base-devel \ +pacman -s --needed --noconfirm base-devel \ git \ exa \ fzf \ @@ -16,11 +16,6 @@ pacman -S --needed --noconfirm base-devel \ bat \ docker \ docker-compose \ - ttf-ubuntu-font-family # Ubuntu Mono font for Alacritty + ttf-ubuntu-font-family # ubuntu mono font for alacritty -# https://rustup.rs/ -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -source $HOME/.cargo/env - -# https://github.com/dandavison/delta#installation -cargo install git-delta +sudo -u $SUDO_USER ./script/installpackagesnonroot diff --git a/script/installpackagesnonroot b/script/installpackagesnonroot new file mode 100755 index 0000000..4e7b38c --- /dev/null +++ b/script/installpackagesnonroot @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# +# install nonsudo packages + +# https://rustup.rs/ +curl --proto '=https' --tlsv1.2 -ssf https://sh.rustup.rs | sh -s -- -y + +# https://github.com/dandavison/delta#installation +cargo install git-delta