Update the update and options and install to correctly pass the args to update script

This commit is contained in:
Bishoy Ehab
2025-10-17 13:21:32 +03:00
parent ab0049ec5c
commit 2272b94531
3 changed files with 19 additions and 9 deletions
+15 -8
View File
@@ -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
+1
View File
@@ -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)"
+3 -1
View File
@@ -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;;