0

this is my first question ever on StackOverflow.

I am a Mac user and I can normally run multiple command-line commands simply by using & e.g.

gulp & 11ty/eleventy --serve

I have been informed that this doesn't work on Windows. But this does work on Windows:

gulp "&" 11ty/eleventy --serve

Therefore, in my package.json I’ve had to do this (below), and it doesn't look so smart, to me:

"scripts": {
    "dev": "gulp & npx @11ty/eleventy --serve",
    "dev-win": "gulp \"&\" npx @11ty/eleventy --serve"
}

Is there a better way? one way that works for both Mac and Windows terminals?

  • When you say that `"&"` works on Windows, what command window are you using? The `&` in a Mac terminal starts the prior command in the background while it moves on to execute the next command in the line. The Windows CMD doesn't support `&` or `"&"` for this purpose. See, for example, [How to run a command in the background on Windows](https://stackoverflow.com/questions/21031171/how-to-run-a-command-in-the-background-on-windows) – lurker Jul 24 '20 at 10:55
  • Hi, sorry I have no means of checking this out (I should have added that I don’t have Windows, and I am not a Windows user). I'm just receiving feedback from a Windows user who’s encountered a problem with my GitHub repo at https://github.com/SimonPadbury/eleventy-gulp-and-sass — she just said that the `&` didn't work but when she put quotes around it, it worked on Windows. I cannot clarify further. – Simon Padbury Jul 25 '20 at 07:48

0 Answers0