1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-06 10:51:11 +01:00

Merge pull request #462 from scorphus/fish-alias

#N/A Remove fucked up cmd from history regardless of status
This commit is contained in:
Vladimir Iakovlev 2016-02-22 15:48:06 +03:00
commit c8e9606c7d

View File

@ -15,17 +15,13 @@ class Fish(Generic):
def app_alias(self, fuck): def app_alias(self, fuck):
return ('function {0} -d "Correct your previous console command"\n' return ('function {0} -d "Correct your previous console command"\n'
' set -l exit_code $status\n'
' set -l fucked_up_command $history[1]\n' ' set -l fucked_up_command $history[1]\n'
' env TF_ALIAS={0} PYTHONIOENCODING=utf-8' ' env TF_ALIAS={0} PYTHONIOENCODING=utf-8'
' thefuck $fucked_up_command | read -l unfucked_command\n' ' thefuck $fucked_up_command | read -l unfucked_command\n'
' if [ "$unfucked_command" != "" ]\n' ' if [ "$unfucked_command" != "" ]\n'
' eval $unfucked_command\n' ' eval $unfucked_command\n'
' if test $exit_code -ne 0\n'
' history --delete $fucked_up_command\n' ' history --delete $fucked_up_command\n'
' history --merge ^ /dev/null\n' ' history --merge ^ /dev/null\n'
' return 0\n'
' end\n'
' end\n' ' end\n'
'end').format(fuck) 'end').format(fuck)