summaryrefslogtreecommitdiff
path: root/hooks/before_platform_add
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2017-09-21 12:49:18 -0400
committerPliable Pixels <pliablepixels@gmail.com>2017-09-21 12:49:18 -0400
commitb28028ac4082842143b0f528d6bc539da6ccb419 (patch)
tree1e26ea969a781ed8e323fca4e3c76345113fc694 /hooks/before_platform_add
parent676270d21beed31d767a06c89522198c77d5d865 (diff)
mega changes, including updates and X
Diffstat (limited to 'hooks/before_platform_add')
-rwxr-xr-xhooks/before_platform_add/init_directories.js23
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) {}