瀏覽代碼

Fix `prepare` when using as git repository dependency

Co-authored-by: Ernesto García <ernestognw@gmail.com>
Co-authored-by: cairo <cairoeth@protonmail.com>
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
danilo neves cruz 1 年之前
父節點
當前提交
e5962430d7
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 1 1
      package.json
  2. 5 0
      scripts/prepare.sh

+ 1 - 1
package.json

@@ -13,7 +13,7 @@
     "coverage": "scripts/checks/coverage.sh",
     "docs": "npm run prepare-docs && oz-docs",
     "docs:watch": "oz-docs watch contracts docs/templates docs/config.js",
-    "prepare": "git config --local core.hooksPath .githooks",
+    "prepare": "scripts/prepare.sh",
     "prepare-docs": "scripts/prepare-docs.sh",
     "lint": "npm run lint:js && npm run lint:sol",
     "lint:fix": "npm run lint:js:fix && npm run lint:sol:fix",

+ 5 - 0
scripts/prepare.sh

@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+if git status &>/dev/null; then git config core.hooksPath .githooks; fi