24 lines
613 B
JavaScript
24 lines
613 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) {
|
|
console.log(err)
|
|
});
|
|
|
|
});
|