truffle-box
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -15,7 +15,10 @@ var fs = require("fs-extra"); | ||
return Promise.resolve().then(function() { | ||
var config_path = path.join(destination, "truffle.js"); | ||
var alternate_path = path.join(destination, "truffle-config.js"); | ||
if (fs.existsSync(config_path) || fs.existsSync(alternate_path)) { | ||
throw new Error("A Truffle project already exists at the destination. Stopping to prevent overwriting data."); | ||
var contents = fs.readdirSync(destination); | ||
if (contents.length) { | ||
var err = "Something already exists at the destination. " + | ||
"Please unbox in an empty folder. " + | ||
"Stopping to prevent overwriting data." | ||
throw new Error(err); | ||
} | ||
@@ -22,0 +25,0 @@ }) |
{ | ||
"name": "truffle-box", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Truffle project boilerplate utility", | ||
@@ -5,0 +5,0 @@ "main": "box.js", |
@@ -43,3 +43,3 @@ var path = require("path"); | ||
it("won't re-init if truffle.js file exists", function(done) { | ||
it("won't re-init if anything exists in the destination folder", function(done) { | ||
this.timeout(5000); | ||
@@ -64,3 +64,3 @@ | ||
.catch(function(e) { | ||
if (e.message.indexOf("A Truffle project already exists at the destination.") >= 0) { | ||
if (e.message.indexOf("Something already exists at the destination.") >= 0) { | ||
done(); | ||
@@ -67,0 +67,0 @@ } else { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
574
20739
2