Ask for confirmation in install script
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
parent
5c401ac0f6
commit
1c7b6a328a
2 changed files with 52 additions and 34 deletions
74
install
74
install
|
@ -19,8 +19,6 @@
|
|||
###############################################################################
|
||||
# Configuration variables #
|
||||
###############################################################################
|
||||
set -e
|
||||
|
||||
HOST="$(hostname)"
|
||||
|
||||
# Directories which should be created
|
||||
|
@ -178,16 +176,13 @@ COPY_ROOT_FILES=(
|
|||
echo "${BOLD}Before you continue with this script make sure that:"
|
||||
echo " • The user severin is added to the sudoers file"
|
||||
echo " • The multilib repository is uncommented in /etc/pacman.conf"
|
||||
echo -e " • Your SSH keys are located in ~/.ssh${RESET}"
|
||||
echo -e " • Your SSH keys are located in ~/.ssh${RESET}\n"
|
||||
|
||||
read -p "Are you ready to continue? (y/n): " -n 1 -r
|
||||
echo ""
|
||||
|
||||
if [[ $REPLY =~ ^[nN]$ ]]
|
||||
then
|
||||
exit
|
||||
if ! ask_prompt "Are you ready to continue?"; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Work specific settings #
|
||||
###############################################################################
|
||||
|
@ -217,39 +212,50 @@ fi
|
|||
# print_log "yay is already installed"
|
||||
# fi
|
||||
|
||||
print_section "Installing native packages"
|
||||
# List created using: yay -Qqen > packages.native.list
|
||||
package_count=$(< "${PACKAGES_DIR}/packages.native.list" wc -l)
|
||||
print_log "Installing ${package_count} packages"
|
||||
yay -Syy > /dev/null 2>&1
|
||||
yay -S --noconfirm --sudoloop --needed --devel --nopgpfetch --mflags --skippgpcheck - < "${PACKAGES_DIR}/packages.native.list"
|
||||
|
||||
# print_section "Installing Rust toolchain and components"
|
||||
# rustup toolchain install beta
|
||||
# rustup default beta
|
||||
# rustup component add "${RUST_COMPONENTS[@]}"
|
||||
# rustup default beta
|
||||
if ask_prompt "Do you want to install ${package_count} Arch packages?"; then
|
||||
print_log "Installing ${package_count} Arch packages"
|
||||
yay -Syy > /dev/null 2>&1
|
||||
yay -S --noconfirm --sudoloop --needed --devel --nopgpfetch --mflags --skippgpcheck - < "${PACKAGES_DIR}/packages.native.list"
|
||||
fi
|
||||
|
||||
|
||||
if ask_prompt "Do you want to install a rust toolchain?"; then
|
||||
rustup toolchain install beta
|
||||
rustup default beta
|
||||
rustup component add "${RUST_COMPONENTS[@]}"
|
||||
rustup default beta
|
||||
fi
|
||||
|
||||
|
||||
print_section "Installing AUR packages"
|
||||
package_count=$(< "${PACKAGES_DIR}/packages.aur.list" wc -l)
|
||||
# List created using: yay -Qqem > packages.aur.list
|
||||
print_log "Installing ${package_count} packages"
|
||||
yay -Syy > /dev/null 2>&1
|
||||
yay -S --noconfirm --sudoloop --needed --devel --nopgpfetch --mflags --skippgpcheck - < "${PACKAGES_DIR}/packages.aur.list"
|
||||
package_count=$(< "${PACKAGES_DIR}/packages.aur.list" wc -l)
|
||||
|
||||
if ask_prompt "Do you want to install ${package_count} AUR packages?"; then
|
||||
print_log "Installing ${package_count} AUR packages"
|
||||
yay -Syy > /dev/null 2>&1
|
||||
yay -S --noconfirm --sudoloop --needed --devel --nopgpfetch --mflags --skippgpcheck - < "${PACKAGES_DIR}/packages.aur.list"
|
||||
fi
|
||||
|
||||
# Remove unneeded packages
|
||||
#yay -Rsu $(comm -23 <(pacman -Qq | sort) <(cat "${PACKAGES_DIR}/packages.native.list" "${PACKAGES_DIR}/packages.aur.list" | sort))
|
||||
|
||||
#print_section "Installing global npm packages"
|
||||
#print_log "Installing ${#NPM_PACKAGES[@]} packages"
|
||||
#npm i -g "${NPM_PACKAGES[@]}"
|
||||
#
|
||||
#print_section "Installing global composer packages"
|
||||
#print_log "Installing ${#COMPOSER_PACKAGES[@]} packages"
|
||||
#composer global require "${COMPOSER_PACKAGES[@]}"
|
||||
#
|
||||
#print_section "Installing ruby gems"
|
||||
#print_log "Installing ${#RUBY_GEMS[@]} packages"
|
||||
#gem install "${RUBY_GEMS[@]}"
|
||||
if ask_prompt "Do you want to install ${#NPM_PACKAGES[@]} global npm packages?"; then
|
||||
print_log "Installing ${#NPM_PACKAGES[@]} packages"
|
||||
npm i -g "${NPM_PACKAGES[@]}"
|
||||
fi
|
||||
|
||||
if ask_prompt "Do you want to install ${#COMPOSER_PACKAGES[@]} global composer packages?"; then
|
||||
print_log "Installing ${#COMPOSER_PACKAGES[@]} packages"
|
||||
composer global require "${COMPOSER_PACKAGES[@]}"
|
||||
fi
|
||||
|
||||
if ask_prompt "Do you want to install ${#RUBY_GEMS[@]} ruby gems?"; then
|
||||
print_log "Installing ${#RUBY_GEMS[@]} gems"
|
||||
gem install "${RUBY_GEMS[@]}"
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
# Creating directories #
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue