From ca12143baa74f8be8fffbc2d5c207bddfa73104b Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Sat, 10 Feb 2024 16:37:35 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Improve=20dot=20script=20options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/dot.fish | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/script/dot.fish b/script/dot.fish index 6ce22ea..cc4d8c7 100755 --- a/script/dot.fish +++ b/script/dot.fish @@ -2,10 +2,9 @@ set -q DOT || set -gx DOT "$HOME/dotfiles" -set -g yes_to_all false -set -g set_prefs true -set -g link_files true -set -g run_installers true +set -g set_prefs false +set -g link_files false +set -g run_installers false source "$DOT/script/utils.fish" @@ -114,9 +113,7 @@ function install_dotfiles set -g overwrite_all false set -g backup_all false - if set -q yes_to_all && $yes_to_all - set skip_all true - else if set -q _flag_s + if set -q _flag_s set skip_all true end @@ -140,25 +137,24 @@ end # Main # ################################################################################ -argparse y/yes-to-all s/skip o/overwrite b/backup p/only-prefs i/only-installers l/only-link -- $argv - -if set -q _flag_y - set yes_to_all true -end +argparse s/skip o/overwrite b/backup p/only-prefs i/only-installers l/only-link -- $argv if set -q _flag_p - set run_installers false - set link_files false + set set_prefs true end if set -q _flag_i - set set_prefs false - set link_files false + set run_installers true end if set -q _flag_l - set run_installers false - set set_prefs false + set link_files true +end + +if ! set -q _flag_p && ! set -q _flag_i && ! set -q _flag_l + set set_prefs true + set run_installers true + set link_files true end # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -