26 lines
711 B
JavaScript
26 lines
711 B
JavaScript
const ghpages = require('gh-pages');
|
|
const path = require('path');
|
|
const fs = require('fs-extra')
|
|
|
|
const pathOfPublic = path.join(__dirname, 'public');
|
|
const pathOfV1 = path.join(pathOfPublic, 'v1');
|
|
const pathOfApps = path.join(pathOfV1, 'apps');
|
|
const pathOfList = path.join(pathOfV1, 'autoGeneratedList.json');
|
|
|
|
fs.readdir(pathOfApps, function (err, items) {
|
|
for (var i = 0; i < items.length; i++) {
|
|
items[i] = items[i].replace('.json', '');
|
|
}
|
|
|
|
fs.outputJsonSync(pathOfList, {
|
|
appList: items
|
|
});
|
|
|
|
ghpages.publish('public', function (err) {
|
|
if (err)
|
|
console.log(err);
|
|
else
|
|
console.log('Built and deployed successfully');
|
|
});
|
|
|
|
}); |