Make scripts terminate with a non-zero error code upon failure.

This commit is contained in:
László Monda
2019-07-20 13:04:11 +02:00
parent 7c6da6c4e6
commit ffcfce04d5
3 changed files with 6 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env node #!/usr/bin/env node
const uhk = require('./uhk'); const uhk = require('./uhk');
process.on('unhandledRejection', e => {throw e});
(async function() { (async function() {
const device = uhk.getUhkDevice(); const device = uhk.getUhkDevice();
uhk.applyConfig(device); uhk.applyConfig(device);

View File

@@ -2,6 +2,8 @@
const uhk = require('./uhk'); const uhk = require('./uhk');
const device = uhk.getUhkDevice(); const device = uhk.getUhkDevice();
process.on('unhandledRejection', e => {throw e});
(async function() { (async function() {
const operationArg = process.argv[2]; const operationArg = process.argv[2];
const operation = uhk.eepromOperations[operationArg]; const operation = uhk.eepromOperations[operationArg];

View File

@@ -3,6 +3,8 @@ const fs = require('fs');
const program = require('commander'); const program = require('commander');
const uhk = require('./uhk'); const uhk = require('./uhk');
process.on('unhandledRejection', e => {throw e});
(async function() { (async function() {
program program
.usage(`configPath`) .usage(`configPath`)