Skip to content

Commit

Permalink
fish: Use '~' for fisher plugins to allow reloading to always work
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
  • Loading branch information
nathanchance committed Dec 20, 2024
1 parent 14d1194 commit 4d49e67
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
7 changes: 7 additions & 0 deletions fish/functions/esc_home.fish
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion fish/functions/rld.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions fish/functions/upd.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fish/functions/user_setup.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4d49e67

Please sign in to comment.