1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-14 14:48:49 +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:
Haroen Viaene 2016-07-26 08:13:32 +02:00
parent a97416272c
commit c02357c58f

View File

@ -27,6 +27,7 @@ class Fish(Generic):
# It is VERY important to have the variables declared WITHIN the alias
return ('function {0} -d "Correct your previous console command"\n'
' if contains -- -y $argv\n'
' set previous_confirmation_value THEFUCK_REQUIRE_CONFIRMATION\n'
' set THEFUCK_REQUIRE_CONFIRMATION 0\n'
' end\n'
' set -l fucked_up_command $history[1]\n'
@ -35,6 +36,9 @@ class Fish(Generic):
' if [ "$unfucked_command" != "" ]\n'
' eval $unfucked_command\n{1}'
' end\n'
' if contains -- -y $argv\n'
' set THEFUCK_REQUIRE_CONFIRMATION previous_confirmation_value\n'
' end\n'
'end').format(fuck, alter_history)
@memoize