Delete output lib folder before instrumenting
authorKevin Sawicki <kevinsawicki@gmail.com>
Tue, 2 Aug 2016 18:55:37 +0000 (11:55 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Wed, 3 Aug 2016 23:23:38 +0000 (16:23 -0700)
spec/coverage/instrument.js
spec/package.json

index 566b53a..aad98a8 100644 (file)
@@ -7,11 +7,14 @@ var glob = require('glob')
 var Instrumenter = require('istanbul').Instrumenter
 var mkdirp = require('mkdirp')
 var path = require('path')
+var rimraf = require('rimraf')
 
 var instrumenter = new Instrumenter()
 var outputPath = path.join(__dirname, '..', '..', 'out', 'coverage')
 var libPath = path.join(__dirname, '..', '..', 'lib')
 
+rimraf.sync(path.join(outputPath, 'lib'))
+
 glob.sync('**/*.js', {cwd: libPath}).forEach(function (relativePath) {
   var rawPath = path.join(libPath, relativePath)
   var raw = fs.readFileSync(rawPath, 'utf8')
index d673a81..f026858 100644 (file)
@@ -12,6 +12,7 @@
     "mocha": "2.1.0",
     "multiparty": "4.1.2",
     "q": "0.9.7",
+    "rimraf": "^2.5.4",
     "temp": "0.8.1",
     "walkdir": "0.0.7",
     "ws": "0.7.2",