-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js.mst
32 lines (29 loc) · 1.03 KB
/
index.js.mst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const _ = require('lodash');
const fs = require('fs-extra');
module.exports = function (sails) {
return {
initialize: function (cb) {
// Do Some initialisation tasks
// This can be for example: copy files or images to the redbox-portal front end
return cb();
},
//If each route middleware do not exist sails.lift will fail during hook.load()
routes: {
before: {},
after: {
}
},
configure: function () {
//If assets directory exists, there must be some assets to copy over
if(fs.pathExistsSync("node_modules/{{ packageName }}/assets/")) {
sails.log.info("Copying JCU branding");
fs.copySync("node_modules/{{ packageName }}/assets/","assets/");
fs.copySync("node_modules/{{ packageName }}/assets/",".tmp/public/");
}
//If views directory exists, there must be some views to copy over
if(fs.pathExistsSync("node_modules/{{ packageName }}/views/")) {
fs.copySync("node_modules/{{ packageName }}/views/","views/");
}
}
}
};