Giter Site home page Giter Site logo

Comments (4)

Kasheftin avatar Kasheftin commented on June 25, 2024 1

Anything with && works incorrect (and with ; as well). For example, echo 1 && echo 2 should output 1 and 2.
That's the exact code:

module.exports = function(grunt) {
  config.exec = {
    test: {
      cmd: "echo 1 && echo 2"
    }
  }
  grunt.initConfig(config);
  grunt.loadNpmTasks("grunt-exec");
  grunt.registerTask("test",["exec:test"]);
}

There's splitArgs function, it count everything after the first space as command argument. That's the grunt test --verbose result:

Running "exec:test" (exec) task
Verifying property exec.test exists in config...OK
File: [no files]    

echo 1 && echo 2
buffer   : disabled
timeout  : infinite
killSig  : SIGTERM
shell    : true
command  : echo
args     : [1,&&,echo,2]
stdio    : [ignore,pipe,pipe]
cwd      : /home/www/obzor/html/tools
exitcodes: 0
pid     : 23072
>> Exited with code: 0.
1 && echo 2

So the result is 1 && echo 2 - everything after the first space counts as the first echo's command argument.

from grunt-exec.

gwicksted avatar gwicksted commented on June 25, 2024

I'll fire up a Linux VM and test. Can you send me the error message? The following is working for me in Windows:

test_multiple_commands: {
      cmd: 
        process.platform === "win32" ? 
              "(rmdir /s /q build || echo 'no build dir')" +
              " && " +
              "mkdir build" +
              " && " +
              "copy * build" +
              " && " +
              "echo done"
            : "rm -rf build" +
              " && " +
              "cp * build" +
              " && " +
              "echo done"
    }

from grunt-exec.

kiyanwang avatar kiyanwang commented on June 25, 2024

having the same problem as @Kasheftin any thoughts on how to resolve this?

from grunt-exec.

gwicksted avatar gwicksted commented on June 25, 2024

Fixed. Please retry with grunt-exec 3.0.0 (bumped major due to possibly breaking changes relying on incorrect quote/space handling of v2 on non-win32).

from grunt-exec.

Related Issues (20)

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.