aboutsummaryrefslogtreecommitdiffstats
path: root/testing/thefuck/ash.patch
blob: 157c9068f037a260d5fef8a423854f43939e2b0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
This patch replaces the default call to "fc" (which is a builtin
function in many shells) to a sed command to work on the alpine
default shell (ash).

--- old/thefuck/shells/generic.py
+++ new/thefuck/shells/generic.py
@@ -37,7 +37,7 @@
 
     def app_alias(self, alias_name):
         return """alias {0}='eval "$(TF_ALIAS={0} PYTHONIOENCODING=utf-8 """ \
-               """thefuck "$(fc -ln -1)")"'""".format(alias_name)
+               """thefuck "$(sed -n '\"'x;\\$p'\"' /home/build/.ash_history)")'""".format(alias_name)
 
     def instant_mode_alias(self, alias_name):
         warn("Instant mode not supported by your shell")