Skip to content

Commit

Permalink
Convert doc code example to async/await
Browse files Browse the repository at this point in the history
  • Loading branch information
malept committed May 25, 2019
1 parent 7502d09 commit a4512ee
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,18 @@ const options = {
arch: 'x86_64'
}

console.log('Creating package (this may take a while)')
async function main (options) {
console.log('Creating package (this may take a while)')

installer(options)
.then(() => console.log(`Successfully created package at ${options.dest}`))
.catch(err => {
try {
await installer(options)
console.log(`Successfully created package at ${options.dest}`)
} catch (err) {
console.error(err, err.stack)
process.exit(1)
})
}
}
main(options)
```

You'll end up with the package at `dist/installers/app-0.0.1.x86_64.rpm`.
Expand Down

0 comments on commit a4512ee

Please sign in to comment.