gulpjs / gulpjs.github.io

The gulp website
http://gulpjs.com
44 stars 44 forks source link

Use of *nix only commands in cli examples may confuse windows users #46

Closed ansballard closed 5 years ago

ansballard commented 7 years ago

Specifically, $ touch gulpfile.js in img/cli.svg. Since it's just going to throw a "command not found" on windows, it may be best to swap it for something or remove that line altogether, since gulp --help just throws a different error about needing a default task. There's also the option to detect windows users and swap the line for a windows alternative when detected, but I doubt you all want to add any javascript at this point. Thoughts?

ansballard commented 7 years ago

Well I haven't come up with any great options. There's the type command that's almost perfect, but the usage is different between OS's. The windows command is type NUL >> gulpfile.js, and nix is type >> gulpfile.js. So that still requires detecting what the user is running with javascript.

We could do it in node, which they need to run gulp in the first place, but it's dirty. node -e require("fs").writeFileSync("./gulpfile.js", ""), so I don't think that's viable, unless there's a more succinct way.

phated commented 7 years ago

I don't like many of those solutions. Could we add a BASH comment saying *nix only on that line or something? Or maybe or create this file?

ansballard commented 7 years ago

Tried both, I think I like or create this file better with the font. Sorry for the quality, kap decided not to work today.

or create this file:

http://i.giphy.com/26gs8CWLCrD3xYByw.gif

*nix only

http://i.giphy.com/l3q2PPDNhJLYushZS.gif

yocontra commented 7 years ago

Did anyone ever make a gulp init command or a useful help command? We can get rid of the touch command from the example if the CLI had a really helpful view.

sumnerevans commented 7 years ago

Is echo "" > gulpfile.js or echo > gulpfile.js cross platform?

ansballard commented 7 years ago

Both commands leave some junk text in the file on windows. The first contains "" and the second ECHO is on.

phated commented 7 years ago

Yeah, I was pretty sure echo wasn't a "proper" echo in windows. 😦 I'm still considering a flag (like --init or something) to make this more cross-platform friendly.