Comments (4)
Joining opts.args
on space is a little naive, as arguments could contain spaces. Trying to quote them could be a huge mess.
from grunt.
Agreed on the naivety, that was the trade-off for maintaining a backwards compatible argument with the existing implementation. I guess from my perspective, if I had to put quotes around the argument in the command line, I'd expect to have to do the same when passing those values to this helper.
from grunt.
The built-in grunt file.expand
method handles wildcard globbing, so you don't need to rely on the shell to do that. Not to mention that file globbing rules might be different on Windows, which could potentially cause portability issues.
I recommend using the built-in child_process
helper (note, I just rewrote it today) along with file.expand
to handle these scenarios. Also, you will probably have more control if you use handlebars programmatically via its JavaScript API instead of invoking it as a child process.
from grunt.
Cool, thanks very much for the pointer to file.expand, that accomplishes what I was looking for. I've trashed my implementation and I'll keep an eye out for the child_process to util move in the next release. Thanks for your help!
from grunt.
Related Issues (20)
- Grunt is using glob as external library which is slow for some of the pattern
- Repetition of compressed code when compressing css and js files
- Add a security policy
- options.process is undefined even though it's in the options block HOT 1
- grunt.file.copy not compatible with grunt-contrib-copy in case of copying symlink HOT 4
- Getting Started with Grunt HOT 3
- start testing 3 latest stable branches HOT 1
- Removal of support for a NodeJS version is a breaking change - major bump? HOT 2
- grunt v1.6.0 throwing error "SyntaxError: Unexpected token '.'" through npm rimraf package. HOT 6
- Latest version of grunt failing if we use path.join for windows HOT 2
- fix for windows incompatibility issue HOT 1
- Regarding Grunt Version 1.6.0 Release
- Regarding Grunt Version 1.6.0 Release HOT 2
- Add an option to copy task for symlinks
- file.mkdir does not create intermediate directories any more
- watchtask callback not firing for the very first time
- + ~~~~~~~~~~~~~~~~~~~ [<<==>>] Exception: Grunt Errord\Grunt.ps HOT 1
- fix : Change twitter icon to new one 'X' HOT 5
- Security Policy needs updating HOT 1
- Issue launching grunt after upgrading to Angular 16 due to locate-path versions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt.