mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-19 09:08:47 +00:00
make sure to only change the CONF value once
done by setting the old variable to a different value, then after the command has been run setting the `THEFUCK_REQUIRE_CONFIRMATION` back to whatever it used to be
This commit is contained in:
parent
a97416272c
commit
c02357c58f
@ -27,6 +27,7 @@ class Fish(Generic):
|
|||||||
# It is VERY important to have the variables declared WITHIN the alias
|
# It is VERY important to have the variables declared WITHIN the alias
|
||||||
return ('function {0} -d "Correct your previous console command"\n'
|
return ('function {0} -d "Correct your previous console command"\n'
|
||||||
' if contains -- -y $argv\n'
|
' if contains -- -y $argv\n'
|
||||||
|
' set previous_confirmation_value THEFUCK_REQUIRE_CONFIRMATION\n'
|
||||||
' set THEFUCK_REQUIRE_CONFIRMATION 0\n'
|
' set THEFUCK_REQUIRE_CONFIRMATION 0\n'
|
||||||
' end\n'
|
' end\n'
|
||||||
' set -l fucked_up_command $history[1]\n'
|
' set -l fucked_up_command $history[1]\n'
|
||||||
@ -35,6 +36,9 @@ class Fish(Generic):
|
|||||||
' if [ "$unfucked_command" != "" ]\n'
|
' if [ "$unfucked_command" != "" ]\n'
|
||||||
' eval $unfucked_command\n{1}'
|
' eval $unfucked_command\n{1}'
|
||||||
' end\n'
|
' end\n'
|
||||||
|
' if contains -- -y $argv\n'
|
||||||
|
' set THEFUCK_REQUIRE_CONFIRMATION previous_confirmation_value\n'
|
||||||
|
' end\n'
|
||||||
'end').format(fuck, alter_history)
|
'end').format(fuck, alter_history)
|
||||||
|
|
||||||
@memoize
|
@memoize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user