Coder Social home page Coder Social logo

is-ci-cli's Introduction

is-ci-cli CI

Run different npm scripts in a CI environment

Install

Ensure you have Node.js version 8+ installed. Then run the following:

npm install --dev is-ci-cli

Usage

In your package.json:

"scripts": {
  "test": "is-ci-cli test:ci test:local"
}

When in a CI environment (as detected by is-ci), this runs the first argument as an npm (or yarn) script. Otherwise, run the 2nd argument (if provided)

License

MIT

is-ci-cli's People

Contributors

adierkens avatar kubajastrz avatar stramel avatar yellowkirby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

is-ci-cli's Issues

AppVeyor error

Hi!

AppVeyor fails (1.1.1) with following:

> [email protected] postinstall C:\projects\chatinder
> is-ci 'ci:skip' 'install:types'
npm ERR! missing script: 'ci:skip'

OS X build works

AppVeyor buid fails

Hi!

My build on AppVeyor fails with:

> [email protected] postinstall C:\projects\chatinder
> is-ci 'ci:skip' 'install:types'
internal/child_process.js:317
    throw errnoException(err, 'spawn');
    ^
Error: spawn UNKNOWN
    at exports._errnoException (util.js:1026:11)
    at ChildProcess.spawn (internal/child_process.js:317:11)
    at Object.exports.spawn (child_process.js:471:9)
    at run (C:\projects\chatinder\node_modules\is-ci-cli\cli.js:11:23)
    at Object.<anonymous> (C:\projects\chatinder\node_modules\is-ci-cli\cli.js:25:15)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

Spawn is not a function

I just upgraded to version 2.1.0. Since then, my npm scripts are failing with the following error:

return spawn(
       ^

TypeError: spawn is not a function
    at run (/Users/***/node_modules/is-ci-cli/cli.js:29:10)
    at Object.<anonymous> (/Users/***/node_modules/is-ci-cli/cli.js:42:16)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47

My script is as follow:

  "scripts": {
    "build": "is-ci \"build:production\" \"build:tsc\"",
    "build:tsc": "tsc",
    "build:production": "npm run prestart",
  }

And my dependencies like:

  "devDependencies": {
    "is-ci-cli": "^2.1.0",
  },

Not sure if I am missing a dependency or not. For now I am reverting back to 2.0

Fails when using NPM v7

These are my scripts in package.json:

"test": "is-ci \"test:coverage\" \"test:watch\"",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage"

Running npm test fails in npm v7 ([email protected], [email protected]):

$ npm test

> [email protected] test
> is-ci "test:coverage" "test:watch"

npm ERR! code 1
npm ERR! path /home/lynxtaa/code/vk-group-tracking-bot
npm ERR! command failed
npm ERR! command sh -c is-ci "test:coverage" "test:watch"

Feature request: Pass additional flags to spawned commands

Example setup:

{
  "scripts": {
    "test": "is-ci \"test:ci\" \"test:local\"",
    "test:ci": "jest --config jest.ci.config.js",
    "test:local": "jest --config jest.local.config.js"
  }
}

I want to be able to pass additional flags to my jest wrappers locally and in CI:

yarn test --watch 
# jest --config jest.local.config.js --watch
export CI=1
yarn test --coverage --coverageReporters=text-summary
# jest --config jest.ci.config.js --coverage --coverageReporters=text-summary

Hey Brah

Hey yellow kirby

vs me 1 on 1

I would say I'm the true yellow kirby, but you obviously hold that title. I do however always play yellow kirby

do you have a twitter or email I can add you to my contacts with?

my email is [email protected] you SOAB

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.