Further tidying and making

This commit is contained in:
2020-02-25 21:09:30 +00:00
committed by Andrejus
parent 549d6ce88d
commit c4ce39b965
15 changed files with 101 additions and 68 deletions

View File

@@ -8,25 +8,26 @@ 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"
if [ "$USER" == "root" ]
then
printf "Failed: ${C_RED}Running as root${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
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
touch "$lock_file" # Requires clean
# Run all install scripts
for script in "$dotfiles_dir/install/*.sh"; do
printf "$script\n\n"
script_filter="$install_dir/*.sh"
for script in $script_filter
do
# Avoid pattern matching self
[ -e "$script" ] || continue