From ea4cefac48e0dad7ac5aeded01b806ddda1da5e6 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Mon, 22 Feb 2021 15:39:50 +0800 Subject: [PATCH] ci: upgrade freebsd image --- .cirrus.yml | 4 ++-- .husky/.gitignore | 1 + .husky/pre-commit | 4 ++++ package.json | 6 ++++-- 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .husky/.gitignore create mode 100755 .husky/pre-commit diff --git a/.cirrus.yml b/.cirrus.yml index dcac4249..08fd96ad 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,8 +1,8 @@ freebsd_instance: - image: freebsd-12-1-release-amd64 + image: freebsd-12-2-release-amd64 task: - name: FreeBSD 12.1 + name: FreeBSD 12.2 env: DEBUG: 'napi:*' setup_script: diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 00000000..c9cdc63b --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..f5c8eadb --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn lint-staged && cargo fmt --all \ No newline at end of file diff --git a/package.json b/package.json index f803c88d..5088fb77 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,10 @@ "format:source": "prettier --config ./package.json --write './**/*.{js,ts}'", "format:yaml": "prettier --parser yaml --write './**/*.{yml,yaml}'", "lint": "eslint -c .eslintrc.yml './cli/**/*.ts' './test_module/**/*.{ts,js}'", - "prepublishOnly": "npm run build", - "test": "ava" + "prepublishOnly": "npm run build && pinst --disable", + "test": "ava", + "postinstall": "husky install", + "postpublish": "pinst --enable" }, "bugs": { "url": "https://github.com/napi-rs/napi-rs/issues"