Git Product home page Git Product logo

gulp-run-command's People

Contributors

andrewleedham avatar klathmon avatar zhaparoff 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

Watchers

 avatar  avatar  avatar

gulp-run-command's Issues

should on Exit exception be suppressed by ignoreErrors?

It seems that if

proc.on('exit', (code) => {
    if (parseInt(code, 10) === 0) {
      resolve()
    } else {
      throw new Error(`Non-zero exit code of "${code}"`)
    }
  })

enters new Error, while ignoreErrors = true. The Exception is not caught or suppressed by the top try /catch. Has this always been the intended functionality or is it a bug?

command is not run, no output

Not sure what I'm doing wrong, but I am replacing a npm script. This was my package.json:

{
  ...
  "scripts": {
    "deploy-stage": "export AWS_PROFILE=${PROJECT}-${STAGE} && ../../node_modules/serverless/bin/serverless deploy --verbose --stage $STAGE --region eu-west-2 --aws-s3-accelerate",
  }

And this is the gulp version:

const gulp = require('gulp')
const gutil = require('gulp-util')
const run = require('gulp-run-command').default

gulp.task('deploy', () => {
  const PROJECT = 'sls'
  const STAGE = 'dev'
  const REGION = 'eu-west-2'
  
  run(`${__dirname}/../../node_modules/serverless/bin/serverless deploy
    --verbose --stage ${STAGE} --region ${REGION} --aws-s3-accelerate`, {
      env: {
        AWS_PROFILE: `${PROJECT}-${STAGE}`
      }
  })
  
  gutil.log('post-deploy')
})

But when I run gulp deploy, it gives:

Toms-MBP-2:api tommedema$ gulp deploy
[23:45:02] Using gulpfile ~/Drive/education/serverless/serverless-aws-crud-starter/services/api/gulpfile.js
[23:45:02] Starting 'deploy'...
[23:45:02] post-deploy
[23:45:02] Finished 'deploy' after 3.72 ms

Without any error messages whatsoever. I thought it could be since there is no use of async/await, promises, or callbacks (so gulp wouldn't know when run was finished); but then again you are not doing this in your example either.

This is with node v8.9.3 LTS

runCommand breaks colour output on Windows

I've got a Gulpfile like this:

gulp.task('which-user', [], function() {
  return runCommand('bash -lc "echo $USER"', { quiet: false })();
});

However when it hits the runCommand, the output loses its ANSI/colours, and I get nasty colour codes:

colours broken

Of course if I run gulp --no-color, no colour codes are output, so it works fine:

no colours

It seems to be related to runCommand, even if I change the task to return nothing, it still breaks the colours:

gulp.task('which-user', [], function() {
  return runCommand('true')();
});

Any ideas?

Why is it not working with return?

If i pass in the function its working:

gulp.task('taskName', run(cmd));

But why it is not working if i return the function, which should be exactly the same:

gulp.task(taskName, () => {
    console.log(`running '${cmd}' ...`);
    return run(cmd);
});

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.