diff --git a/install.sh b/install.sh index cea33e7ed..75a28a5a0 100755 --- a/install.sh +++ b/install.sh @@ -11,14 +11,21 @@ set -e ##################################################################################### # For uninstall script - if [[ "${EXPERIMENTAL_UNINSTALL_SCRIPT}" = true ]]; then - source ./sdata/exp/uninstall.sh - exit - fi - if [[ "${EXPERIMENTAL_UPDATE_SCRIPT}" = true ]]; then - source ./sdata/exp/update.sh - exit - fi +if [[ "${EXPERIMENTAL_UNINSTALL_SCRIPT}" = true ]]; then + source ./sdata/exp/uninstall.sh + exit +fi +# For update script +if [[ "${EXPERIMENTAL_UPDATE_SCRIPT}" = true ]]; then + export SOURCED_FROM_INSTALL=true + FILTERED_ARGS=() + for arg in "${ORIGINAL_ARGS[@]}"; do + [[ "$arg" != "--exp-update" ]] && FILTERED_ARGS+=("$arg") + done + set -- "${FILTERED_ARGS[@]}" + source ./sdata/exp/update.sh + exit +fi ##################################################################################### # 0. Before we start if [[ "${SKIP_ALLGREETING}" != true ]]; then diff --git a/sdata/exp/update.sh b/sdata/exp/update.sh index b74254745..3e5b040e3 100755 --- a/sdata/exp/update.sh +++ b/sdata/exp/update.sh @@ -620,6 +620,7 @@ while [[ $# -gt 0 ]]; do echo " -n, --dry-run Show what would be done without making changes" echo " -v, --verbose Enable verbose output" echo " -h, --help Show this help message" + echo " --skip-notice Skip warning notice about script being untested" echo "" echo "This script updates your dotfiles by:" echo " 1. Auto-detecting repository structure (dots/ prefix or direct)" diff --git a/sdata/lib/options.sh b/sdata/lib/options.sh index 8f3d9442d..bf2ff915c 100644 --- a/sdata/lib/options.sh +++ b/sdata/lib/options.sh @@ -16,6 +16,7 @@ If no option is specified, run default install process. --skip-alldeps Skip the whole process installing dependency --skip-allsetups Skip the whole process setting up permissions/services etc --skip-allfiles Skip the whole process copying configuration files + --skip-notice Skip warning notice (for experimental scripts) -s, --skip-sysupdate Skip system package upgrade e.g. \"sudo pacman -Syu\" --skip-hyprland Skip installing the config for Hyprland --skip-fish Skip installing the config for Fish @@ -37,7 +38,7 @@ cleancache(){ # `man getopt` to see more para=$(getopt \ -o hfk:cs \ - -l help,force,fontset:,clean,skip-allgreeting,skip-alldeps,skip-allsetups,skip-allfiles,skip-sysupdate,skip-fish,skip-hyprland,skip-plasmaintg,skip-miscconf,exp-files,via-nix,exp-uninstall,exp-update \ + -l help,force,fontset:,clean,skip-allgreeting,skip-alldeps,skip-allsetups,skip-allfiles,skip-notice,skip-sysupdate,skip-fish,skip-hyprland,skip-plasmaintg,skip-miscconf,exp-files,via-nix,exp-uninstall,exp-update \ -n "$0" -- "$@") [ $? != 0 ] && echo "$0: Error when getopt, please recheck parameters." && exit 1 ##################################################################################### @@ -66,6 +67,7 @@ while true ; do --skip-alldeps) SKIP_ALLDEPS=true;shift;; --skip-allsetups) SKIP_ALLSETUPS=true;shift;; --skip-allfiles) SKIP_ALLFILES=true;shift;; + --skip-notice) SKIP_NOTICE=true;shift;; -s|--skip-sysupdate) SKIP_SYSUPDATE=true;shift;; --skip-hyprland) SKIP_HYPRLAND=true;shift;; --skip-fish) SKIP_FISH=true;shift;;