metalsmith
Advanced tools
Comparing version 0.7.0 to 0.8.0
0.8.0 - May 6, 2014 | ||
------------------- | ||
* add `clean` option | ||
0.7.0 - April 29, 2014 | ||
@@ -3,0 +7,0 @@ ---------------------- |
@@ -11,3 +11,3 @@ | ||
var readdir = require('recursive-readdir'); | ||
var rm = require('rimraf'); | ||
var rm = require('rimraf').sync; | ||
var utf8 = require('is-utf8'); | ||
@@ -35,2 +35,3 @@ var Ware = require('ware'); | ||
this.destination('build'); | ||
this.clean(true); | ||
} | ||
@@ -90,2 +91,13 @@ | ||
/** | ||
* Get or set whether the destination directory will be removed before writing. | ||
* @param {Boolean} clean | ||
* @return {Boolean or Metalsmith} | ||
*/ | ||
Metalsmith.prototype.clean = function(clean){ | ||
if (!arguments.length) return this._clean; | ||
this._clean = clean; | ||
return this; | ||
}; | ||
/** | ||
* Join path `strs` with the working directory. | ||
@@ -187,7 +199,6 @@ * | ||
var dest = this.destination(); | ||
var clean = this.clean(); | ||
rm(dest, function(err){ | ||
if (err) return fn(err); | ||
each(Object.keys(files), write, fn); | ||
}); | ||
if (clean) rm(dest); | ||
each(Object.keys(files), write, fn); | ||
@@ -194,0 +205,0 @@ function write(file, done){ |
{ | ||
"name": "metalsmith", | ||
"repository": "git://github.com/segmentio/metalsmith.git", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "description": "An extremely simple, pluggable static site generator.", |
@@ -142,2 +142,6 @@ # Metalsmith | ||
#### #clean(boolean) | ||
Set whether to remove the destination directory before writing to it, or get the current setting. Defaults to `true`. | ||
#### #metadata(json) | ||
@@ -144,0 +148,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15405
179
190