Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Commit 39e890e

Browse files
committed
Merge pull request #27 from BrandonOCasey/master
Create the directory we are installing to if it does not exist
2 parents 6943b3f + ffcc394 commit 39e890e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ module.exports = {
3232
// copy blueprint and service files
3333
console.log( 'Installing "' + scope.flavor + '" of blueprints.' );
3434

35+
// create blueprints directory if it does not exist
36+
if( ! fs.existsSync( scope.rootPath + '/api/blueprints' ) ) {
37+
fs.mkdirSync( scope.rootPath + '/api/blueprints' );
38+
}
39+
3540
['create', 'destroy', 'find', 'findone', 'populate', 'update'].forEach(function(blueprint) {
3641
fs.writeFileSync(scope.rootPath + '/api/blueprints/' + blueprint + '.js', "module.exports = require('sails-generate-ember-blueprints/templates/" + scope.flavor + "/api/blueprints/" + blueprint + ".js');\n");
3742
});
@@ -44,4 +49,4 @@ module.exports = {
4449
}
4550
},
4651
}
47-
};
52+
};

0 commit comments

Comments
 (0)