From 44c778e844a41205a33425bc7035de0508439ecd Mon Sep 17 00:00:00 2001 From: Vincent Li Date: Mon, 9 Sep 2019 09:51:49 -0400 Subject: [PATCH] Removing is-ci in favor of ci-info --- package-lock.json | 6 ++++++ package.json | 2 +- src/global.d.ts | 2 +- src/installer/bin.ts | 5 ++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 28ba01faa..283073fef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -502,6 +502,11 @@ "@babel/types": "^7.3.0" } }, + "@types/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5R2/MHILQLDCzTuhs1j4Qqq8AaKUf7Ma4KSSkCtc12+fMs47zfa34qhto9goxpyX00tQK1zxB885VCiawZ5Qhg==" + }, "@types/cosmiconfig": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/@types/cosmiconfig/-/cosmiconfig-5.0.3.tgz", @@ -3304,6 +3309,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, "requires": { "ci-info": "^2.0.0" } diff --git a/package.json b/package.json index 85ff7fce9..390244624 100644 --- a/package.json +++ b/package.json @@ -51,10 +51,10 @@ "homepage": "https://github.com/typicode/husky#readme", "dependencies": { "chalk": "^2.4.2", + "ci-info": "^2.0.0", "cosmiconfig": "^5.2.1", "execa": "^1.0.0", "get-stdin": "^7.0.0", - "is-ci": "^2.0.0", "opencollective-postinstall": "^2.0.2", "pkg-dir": "^4.2.0", "please-upgrade-node": "^3.2.0", diff --git a/src/global.d.ts b/src/global.d.ts index 287e13d4a..e7a6f5035 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -1,3 +1,3 @@ declare module 'execa' -declare module 'is-ci' +declare module 'ci-info' declare module 'slash' diff --git a/src/installer/bin.ts b/src/installer/bin.ts index 8e599dac2..b4527a0ef 100644 --- a/src/installer/bin.ts +++ b/src/installer/bin.ts @@ -1,5 +1,5 @@ import chalk from 'chalk' -import isCI from 'is-ci' +import ci from 'ci-info' import path from 'path' import debug from '../debug' import { install, uninstall } from './' @@ -13,6 +13,9 @@ debug(`INIT_CWD: ${process.env.INIT_CWD}`) // huskyDir is ONLY used in dev, don't use this arguments const [, , action, huskyDir = path.join(__dirname, '../..')] = process.argv +// Determine whether environment is CI +const { isCI } = ci.isCI + // Find Git dir try { // Show un/install message