grunt-tree-prepare
Make directory trees.
Clean option can be provided.
You can use this both as gruntjs plugin and as a library for nodejs.
Install
Install with npm:
npm install grunt-tree-prepare --save-dev
Usage
- as JavaScript library.
var emitter = tree optionsemitter;
- Use in your Gruntfile.js task with tree object.
module { // make directory tree below: // process.cwd() // |- foo - <= create if not exist // | |- var <= create if not exist // |- hoge - <= create if not exist // |- fuga <= cleanup and create new gruntconfig; grunt; grunt;};
Configuration
-
options(Object)
"clean"(Boolean)
default: false
Setup clean default for directory.
(not truely/falsy)
"autoDone"(Boolean)
default: true
Flag for task end signal auto call.
If specified false, "tree-prepare.end" event leads "done" argument as an first argument to grunt.event. See test/basic.js. -
tree(Object)
"(Object key)(String)"
Relative path from parent directory. Parent of tree is process.cwd().
"branch"(Array|String)"
Create directories with the same status included in the object that belongs.
"chmod(Number|String)"
default: 777 //TODO
Set directory mode. String representation (e.g. "rw-rw-rw-" as 666) can be given.
"clean(Boolean)"
default: false | options.clean
Crean up ( use rimraf ) directory contents and itself, create new.