Files
dotfiles/install.sh
Andrejus 549d6ce88d Merge branch 'install' of https://github.com/andrejusk/dotfiles
Clean scripts, remove sudo requirement

Add python dependencies

Correctly symlink and add poetry

Update make clean

Add python2 to dependencies

Fix pyenv install

Use pyenv to install python

Update .gitignore

Install git and keybase
2020-02-26 14:47:36 +00:00

49 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
#
# Invokes all install scripts.
#
# Log execution
printf "Installing ${C_CYAN}$repository${C_NC}"
printf " as ${C_YELLOW}$USER${C_NC}\n\n"
# Prevent running as root
if [ "$USER" == "root" ]; then
printf "Failed: ${C_RED}Running as $USER${C_NC}\n"
printf "Please run as user, not ${C_YELLOW}sudo${C_NC}\n"
exit 1
fi
# Prevent concurrent scripts
lock_file="$dotfiles_dir/.$lock_extension"
if [ -f "$lock_file" ]; then
printf "Failed: ${C_RED}Script already running${C_NC}\n"
printf "Please wait for script to exit or ${C_YELLOW}make clean${C_NC}\n"
exit 1
fi
touch $lock_file # Requires clear
# Run all install scripts
for script in "$dotfiles_dir/install/*.sh"; do
printf "$script\n\n"
# Avoid pattern matching self
[ -e "$script" ] || continue
# Log execution
script_name=$(basename "$script" ".sh")
printf "Running ${C_YELLOW}$script_name${C_NC}...\n${C_DGRAY}"
# Run and indent output
source "$script" | indent
printf "${C_NC}\n"
done
# Clean up and exit
printf "Done! Cleaning up...\n${C_DGRAY}"
make clean
printf "${C_NC}\n"
exit 0