Browse Source

Stage files modified by prettier (#5298)

Ben Vinegar 7 years ago
parent
commit
941d7e90ca
1 changed files with 5 additions and 0 deletions
  1. 5 0
      config/hooks/pre-commit

+ 5 - 0
config/hooks/pre-commit

@@ -60,6 +60,11 @@ def js_format(file_list=None):
         ).wait()
         has_errors = status != 0
 
+        if not has_errors:
+            # Stage modifications by Prettier
+            status = subprocess.Popen(['git', 'update-index', '--add'] + file_list).wait()
+            has_errors = status != 0
+
     return has_errors
 
 def main():