Skip to content

Commit ecf8682

Browse files
committed
Refactor build.js using Promise
1 parent 0c69752 commit ecf8682

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

tasks/build.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ function clean () {
2626
function build () {
2727
console.log('\x1b[34mBuilding electron app(s)...\n\x1b[0m')
2828

29-
packager(config, (err, appPaths) => {
30-
if (err) {
31-
console.error('\x1b[31mError from `electron-packager` when building app...\x1b[0m')
32-
console.error(err)
33-
} else {
29+
packager(config)
30+
.then((appPaths) => {
3431
console.log('Build(s) successful!')
3532
console.log(appPaths)
36-
}
37-
})
33+
})
34+
.catch((error) => {
35+
console.error('\x1b[31mError from `electron-packager` when building app...\x1b[0m')
36+
console.error(error)
37+
})
3838
}

0 commit comments

Comments
 (0)