-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.js
46 lines (39 loc) · 1.05 KB
/
build.js
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
34
35
36
37
38
39
40
41
42
43
44
45
46
'use strict'
const p = require('path')
const normalize = require('normalize-path')
const log = require('./logger')
const freshen = require('./freshenUp')
const version = require('./versionUp')
const clone = require('./clone')
const clean = require('./clean')
const zip = require('./zip')
const remove = require('./remove')
const validateOptions = require('./validateOptions')
/**
* Builds the PowerSchool zip file
* @param {object} program The program object received from Commander
*/
module.exports = async program => {
const logger = log(program.quiet)
const tasks = [
freshen,
version,
clone,
clean,
zip,
remove
]
logger.info(`Starting zip of ${program.source}`)
program.zipPath = p.join(program.output, p.basename(program.source) + '.zip')
program.tempSource = normalize(p.join(program.build, '.temp-build'))
try {
validateOptions(program)
for (const task of tasks) {
await task(logger, program)
}
} catch (err) {
logger.error(err.message)
process.exit()
}
logger.info('Build complete!')
}