diff --git a/fish/completions/replay.fish b/fish/completions/replay.fish deleted file mode 100644 index d4589a9..0000000 --- a/fish/completions/replay.fish +++ /dev/null @@ -1,3 +0,0 @@ -complete --command replay --no-files -complete --command replay --exclusive --long version --description "Print version" -complete --command replay --exclusive --long help --description "Print help" diff --git a/fish/fish_plugins b/fish/fish_plugins index 8d3cec2..2c7f7d5 100644 --- a/fish/fish_plugins +++ b/fish/fish_plugins @@ -1,5 +1,4 @@ jorgebucaran/fisher jorgebucaran/nvm.fish -jorgebucaran/replay.fish lilyball/nix-env.fish reitzig/sdkman-for-fish@v2.1.0 diff --git a/fish/functions/replay.fish b/fish/functions/replay.fish deleted file mode 100644 index 809a3b1..0000000 --- a/fish/functions/replay.fish +++ /dev/null @@ -1,48 +0,0 @@ -function replay --description "Run Bash commands replaying changes in Fish" - switch "$argv" - case -v --version - echo "replay, version 1.2.1" - case "" -h --help - echo "Usage: replay Run Bash commands replaying changes in Fish" - echo "Options:" - echo " -v or --version Print version" - echo " -h or --help Print this help message" - case \* - set --local env - set --local sep @$fish_pid(random)(command date +%s) - set --local argv $argv[1] (string escape -- $argv[2..-1]) - set --local out (command bash -c " - $argv - status=\$? - [ \$status -gt 0 ] && exit \$status - - command compgen -e | command awk -v sep=$sep '{ - gsub(/\n/, \"\\\n\", ENVIRON[\$0]) - print \$0 sep ENVIRON[\$0] - }' && alias - ") || return - - string replace --all -- \\n \n ( - for line in $out - if string split -- $sep $line | read --local --line name value - set --append env $name - - contains -- $name SHLVL PS1 BASH_FUNC || test "$$name" = "$value" && continue - - if test "$name" = PATH - echo set PATH (string split -- : $value | string replace --regex --all -- '(^.*$)' '"$1"') - else if test "$name" = PWD - echo builtin cd "\"$value\"" - else - echo "set --global --export $name "(string escape -- $value) - end - else - set --query env[1] && string match --entire --regex -- "^alias" $line || echo "echo \"$line\"" - end - end | string replace --all -- \$ \\\$ - for name in (set --export --names) - contains -- $name $env || echo "set --erase $name" - end - ) | source - end -end