Closed ansballard closed 5 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.
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
?
Tried both, I think I like or create this file
better with the font. Sorry for the quality, kap decided not to work today.
http://i.giphy.com/26gs8CWLCrD3xYByw.gif
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.
Is echo "" > gulpfile.js
or echo > gulpfile.js
cross platform?
Both commands leave some junk text in the file on windows. The first contains ""
and the second ECHO is on.
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.
Specifically,
$ touch gulpfile.js
inimg/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, sincegulp --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?