2022-08-17 00:42:57 +00:00
|
|
|
#!/bin/zsh
|
2022-08-19 02:21:32 +00:00
|
|
|
cd "${0:a:h}"
|
2023-11-19 19:00:51 +00:00
|
|
|
OVERWRITE_EXISTING=0
|
2022-08-19 01:55:18 +00:00
|
|
|
while [[ $# -gt 0 ]]
|
|
|
|
do
|
|
|
|
case $1 in
|
2023-11-15 18:24:59 +00:00
|
|
|
--force-root ) FORCE_ROOT=1 ;;
|
|
|
|
--ci ) export CI=1 ;;
|
2023-11-11 14:40:10 +00:00
|
|
|
|
2023-11-19 19:00:51 +00:00
|
|
|
--overwrite ) OVERWRITE_EXISTING=1 ;;
|
|
|
|
|
2023-11-11 14:40:10 +00:00
|
|
|
--no-compile-dmenu ) COMPILE_DMENU=0 ;;
|
|
|
|
|
|
|
|
--min )
|
2023-11-15 05:48:13 +00:00
|
|
|
MIN=1
|
2023-11-11 14:40:10 +00:00
|
|
|
COMPILE_DMENU=0
|
2022-08-19 01:55:18 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift 1
|
|
|
|
done
|
2022-08-23 04:05:49 +00:00
|
|
|
source ./requirements.zsh || exit 1
|
2022-08-17 00:42:57 +00:00
|
|
|
################################################################################
|
|
|
|
|
|
|
|
LOGFILE="$HOME/dotwryn-install.log"
|
|
|
|
|
2023-06-28 00:30:02 +00:00
|
|
|
INFO "installation start : $(date)" 2>> "$LOGFILE"
|
2022-08-17 00:42:57 +00:00
|
|
|
{
|
2023-06-28 00:30:02 +00:00
|
|
|
SETUP__OS || FAIL 1 'failed to set up os-dependencies (see above)'
|
|
|
|
SETUP__GIT || FAIL 2 'failed to set up git (see above)'
|
|
|
|
SETUP__CONFIG || FAIL 3 'failed to set up program configuration (see above)'
|
2022-08-17 00:42:57 +00:00
|
|
|
} 2>&1 | tee --append "$LOGFILE"
|
|
|
|
|
2023-06-28 00:30:02 +00:00
|
|
|
INFO "installation complete: $(date)" 2>> "$LOGFILE"
|
2022-08-17 00:42:57 +00:00
|
|
|
|
|
|
|
################################################################################
|
2023-11-19 19:00:51 +00:00
|
|
|
yN 'keep logfile?' \
|
|
|
|
|| { rm "$LOGFILE" || ERROR "unable to remove '$LOGFILE'" }
|
|
|
|
|
2024-08-13 18:46:20 +00:00
|
|
|
SUCCESS "\n.wryn setup complete; have a nice day :)\n "
|