@ntlab/sipd-agr 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/app/index.js +13 -7
  2. package/main.js +2 -1
  3. package/package.json +1 -1
package/app/index.js CHANGED
@@ -66,20 +66,26 @@ class App {
66
66
  }
67
67
  const works = sipd.getWorks();
68
68
  if (works) {
69
- sipd.works(works, next => {
70
- setTimeout(() => next(), 500);
71
- }).then(() => {
69
+ sipd.works(works, {
70
+ callback(next) {
71
+ setTimeout(() => next(), 500);
72
+ }
73
+ })
74
+ .then(() => {
72
75
  sipd.app.showMessage('Information', 'The process has been completed! :)');
73
76
  console.log('Done');
74
- }).catch(err => {
77
+ })
78
+ .catch(err => {
79
+ process.exitCode = 2;
75
80
  if (err) {
76
- console.log(err);
81
+ console.error(err);
77
82
  } else {
78
- console.log('Unknown error, aborting!!!');
83
+ console.error('Unknown error, aborting!!!');
79
84
  }
80
85
  });
81
86
  } else {
82
- console.log('Unknown MODE %s!!!', this.config.mode);
87
+ process.exitCode = 1;
88
+ console.error('Unknown mode %s!!!', this.config.mode);
83
89
  }
84
90
  }
85
91
 
package/main.js CHANGED
@@ -29,7 +29,7 @@ const App = require('./app');
29
29
  const Cmd = require('@ntlab/ntlib/cmd');
30
30
 
31
31
  if (!Cmd.parse() || (Cmd.get('help') && usage())) {
32
- process.exit();
32
+ process.exit(process.exitCode !== undefined ? null : 1);
33
33
  }
34
34
 
35
35
  (function run() {
@@ -43,5 +43,6 @@ function usage() {
43
43
  console.log('Options:');
44
44
  console.log(Cmd.dump());
45
45
  console.log('');
46
+ process.exitCode = 0;
46
47
  return true;
47
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ntlab/sipd-agr",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "SIPD RI Kemendagri Automation is a web automation using Selenium to help manage data such as budgeting download",
5
5
  "main": "main.js",
6
6
  "author": "Toha <tohenk@yahoo.com>",