UNPKG

if-ci

Version:

Easily run npm scripts only when in (or not in) a CI environment.

13 lines (9 loc) 254 B
'use strict' const isCI = require('is-ci') const execa = require('execa') module.exports = (shouldBeCI, command, args) => { if (isCI !== shouldBeCI) { return Promise.resolve({ code: 0 }) } return execa(command, args, { stdio: 'inherit' }) }