-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgulpfile.js
More file actions
33 lines (30 loc) · 821 Bytes
/
gulpfile.js
File metadata and controls
33 lines (30 loc) · 821 Bytes
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
33
const { series } = require('gulp')
const fs = require('fs')
const path = require('path')
const YAML = require('yaml')
const rimraf = require('rimraf')
const plugins = fs.readdirSync('./data')
let finalData = {
graviton: {
devVersion: '2.1.8',
betaVersion: '2.0.92',
stableVersion: '0.0.0',
},
list: [],
}
exports.default = series(
function convertYAML(done) {
plugins.forEach((plugin) => {
const manifestYAML = fs.readFileSync(path.join('data', plugin, 'manifest.yaml'), 'UTF-8')
const manifestJSON = YAML.parse(manifestYAML)
finalData.list.push(manifestJSON)
})
done()
},
function createDataFile(done) {
if (fs.existsSync('dist')) rimraf.sync('dist')
fs.mkdirSync('dist')
fs.writeFileSync('dist/data.json', JSON.stringify(finalData))
done()
}
)