From d7f49da52833872f33988b5ae7d12e43bd41dc9d Mon Sep 17 00:00:00 2001 From: maxam2017 Date: Sat, 17 Feb 2024 04:32:28 +0800 Subject: [PATCH] fix: skip preinstall for CI --- package.json | 2 +- preinstall.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 preinstall.sh diff --git a/package.json b/package.json index eb7e9e9fb..4d756105f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "license": "MIT", "type": "module", "scripts": { - "preinstall": "pre-commit install", + "preinstall": "./preinstall.sh", "dev": "ts-node-esm src/index.ts", "build": "tsc && ncc build dist/index.js --minify && find dist/ -type f -not -name 'index.js' -delete", "lint": "biome lint" diff --git a/preinstall.sh b/preinstall.sh new file mode 100755 index 000000000..d41206624 --- /dev/null +++ b/preinstall.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Check if CI variable is set to true +if [ "$CI" = "true" ]; then + echo "CI is true, skipping pre-commit install." +else + # Install pre-commit hooks + pre-commit install +fi