瀏覽代碼

Pre-commit hook that runs tests and lints to avoid build fails (in progress)

Doesn’t work yet — fails even on exit 0

Should only care about files staged for committing, right?
Artur Paikin 9 年之前
父節點
當前提交
5e8bbeadd1
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      pre-commit.hook

+ 7 - 0
pre-commit.hook

@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+PATH=$PATH:/usr/local/bin:/usr/local/sbin
+
+npm run test || echo "Tests (or tasks) failed, aborting the commit" && exit 1
+
+echo "All tests passed, committing your changes"
+exit 0