fish: bump replay to 1.2.1

This commit is contained in:
Charles Gould 2022-07-05 22:51:10 -05:00
parent 07b046f9c4
commit 3314b0b9f6

View File

@ -1,7 +1,7 @@
function replay --description "Run Bash commands replaying changes in Fish" function replay --description "Run Bash commands replaying changes in Fish"
switch "$argv" switch "$argv"
case -v --version case -v --version
echo "replay, version 1.2.0" echo "replay, version 1.2.1"
case "" -h --help case "" -h --help
echo "Usage: replay <commands> Run Bash commands replaying changes in Fish" echo "Usage: replay <commands> Run Bash commands replaying changes in Fish"
echo "Options:" echo "Options:"
@ -10,7 +10,7 @@ function replay --description "Run Bash commands replaying changes in Fish"
case \* case \*
set --local env set --local env
set --local sep @$fish_pid(random)(command date +%s) set --local sep @$fish_pid(random)(command date +%s)
set --local argv $argv[1] \"$argv[2..-1]\" set --local argv $argv[1] (string escape -- $argv[2..-1])
set --local out (command bash -c " set --local out (command bash -c "
$argv $argv
status=\$? status=\$?
@ -24,15 +24,15 @@ function replay --description "Run Bash commands replaying changes in Fish"
string replace --all -- \\n \n ( string replace --all -- \\n \n (
for line in $out for line in $out
if string split $sep $line | read --local --line name value if string split -- $sep $line | read --local --line name value
set --append env $name set --append env $name
contains -- $name SHLVL PS1 BASH_FUNC || test "$$name" = "$value" && continue contains -- $name SHLVL PS1 BASH_FUNC || test "$$name" = "$value" && continue
if test "$name" = PATH if test "$name" = PATH
string replace --all : " " "set $name $value" echo set PATH (string split -- : $value | string replace --regex --all -- '(^.*$)' '"$1"')
else if test "$name" = PWD else if test "$name" = PWD
echo builtin cd \"$value\" echo builtin cd "\"$value\""
else else
echo "set --global --export $name "(string escape -- $value) echo "set --global --export $name "(string escape -- $value)
end end