Add a git_add rule

This commit is contained in:
mcarton
2015-05-06 11:31:31 +02:00
parent fb069b74d7
commit 9380eb1f56
2 changed files with 16 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import re
def match(command, settings):
return ('git' in command.script
and 'did not match any file(s) known to git.' in command.stderr
and "Did you forget to 'git add'?" in command.stderr)
def get_new_command(command, settings):
missing_file = re.findall(
r"error: pathspec '([^']*)' "
"did not match any file\(s\) known to git.", command.stderr)[0]
return 'git add -- {} && {}'.format(missing_file, command.script)