diff options
| author | ARC <arjunrc@gmail.com> | 2015-04-25 09:13:54 -0400 |
|---|---|---|
| committer | ARC <arjunrc@gmail.com> | 2015-04-25 09:13:54 -0400 |
| commit | 86e4e291bfda3365c0bb82bacb2b9990a86ce759 (patch) | |
| tree | c9729d4bd5366656e39761319546593c02f0f709 /hooks/before_platform_add/init_directories.js | |
First Commit
Diffstat (limited to 'hooks/before_platform_add/init_directories.js')
| -rwxr-xr-x | hooks/before_platform_add/init_directories.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/hooks/before_platform_add/init_directories.js b/hooks/before_platform_add/init_directories.js new file mode 100755 index 00000000..babde347 --- /dev/null +++ b/hooks/before_platform_add/init_directories.js @@ -0,0 +1,23 @@ +#!/usr/bin/env node + +/** + * On a fresh clone, the local platforms/ and plugins/ directories will be + * missing, so ensure they get created before the first platform is added. + */ +var fs = require('fs'); +var path = require('path'); + +var platformsDir = path.resolve(__dirname, '../../platforms'); +var pluginsDir = path.resolve(__dirname, '../../plugins'); + +try { + fs.mkdirSync(platformsDir, function (err) { + if (err) { console.error(err); } + }); +} catch(ex) {} + +try { + fs.mkdirSync(pluginsDir, function (err) { + if (err) { console.error(err); } + }); +} catch(ex) {} |
