Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!app.storage.workspace) {
app.dialog.error("Missing Workspace", "Please set your workspace under settings panel");
return false;
}
if (app.storage.currentProject == "BaseProject") {
app.dialog.error("Missing Project", "Please, create a new Project using File>New option");
return false;
}
var fs = require('fs'),
mage = require('mage-engine');
if (!fs.existsSync(dir)){
fs.mkdirSync(dir);
}
mage.builder.create(dir, function(success) {
if (success) {
app.dialog.success("Done", "Your project is good to go");
} else {
app.dialog.error("Error!", "Error while creating project");
}
});
return true;
},