From 2b08a136b59c80bf4d0d04545078156a577279c3 Mon Sep 17 00:00:00 2001 From: dannion Date: Mon, 20 Apr 2015 19:48:27 +0800 Subject: [PATCH] add a rule to run the script you enter by add './' in command's prefix --- thefuck/rules/has_exists_script.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 thefuck/rules/has_exists_script.py diff --git a/thefuck/rules/has_exists_script.py b/thefuck/rules/has_exists_script.py new file mode 100644 index 00000000..7b5dab4c --- /dev/null +++ b/thefuck/rules/has_exists_script.py @@ -0,0 +1,9 @@ +import os + +def match(command, settings): + exist = os.path.exists(command.script) + return exist + +def get_new_command(command, settings): + return './{}'.format(command.script) +