diff --git a/fish/functions/esc_home.fish b/fish/functions/esc_home.fish new file mode 100644 index 00000000..5e8f3712 --- /dev/null +++ b/fish/functions/esc_home.fish @@ -0,0 +1,7 @@ +#!/usr/bin/env fish +# SPDX-License-Identifier: MIT +# Copyright (C) 2024 Nathan Chancellor + +function esc_home -d "Replace $HOME with ~" + string replace $HOME \~ $argv +end diff --git a/fish/functions/rld.fish b/fish/functions/rld.fish index b10df04b..8053ab82 100644 --- a/fish/functions/rld.fish +++ b/fish/functions/rld.fish @@ -3,6 +3,6 @@ # Copyright (C) 2021-2023 Nathan Chancellor function rld -d "Reload fish configuration" - fisher update $ENV_FOLDER/fish 1>/dev/null + fisher update (esc_home $ENV_FOLDER/fish) 1>/dev/null source $__fish_config_dir/config.fish end diff --git a/fish/functions/upd.fish b/fish/functions/upd.fish index 7b271b8b..196880b9 100644 --- a/fish/functions/upd.fish +++ b/fish/functions/upd.fish @@ -28,7 +28,8 @@ function upd -d "Runs the update command for the current distro or downloads/upd continue case fisher - fisher update 1>/dev/null; or return + # Use output of 'fisher list' to ensure '~' stays escaped + fisher update (fisher list) 1>/dev/null; or return continue case hydro @@ -47,7 +48,7 @@ function upd -d "Runs the update command for the current distro or downloads/upd end switch $target case hydro - fisher update $repo 1>/dev/null; or return + fisher update (esc_home $repo) 1>/dev/null; or return end case forks diff --git a/fish/functions/user_setup.fish b/fish/functions/user_setup.fish index 52fccf15..2c989cb5 100644 --- a/fish/functions/user_setup.fish +++ b/fish/functions/user_setup.fish @@ -185,7 +185,7 @@ function user_setup -d "Setup a user account, downloading all files and placing set -a fisher_plugins jethrokuan/z end for fisher_plugin in $fisher_plugins - fisher install $fisher_plugin; or return + fisher install (esc_home $fisher_plugin); or return end # config.fish