This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +30
-12
lines changed
Expand file tree Collapse file tree 2 files changed +30
-12
lines changed Original file line number Diff line number Diff line change @@ -66,12 +66,13 @@ if (fileContents && host) {
6666 } ) ;
6767 } ) ;
6868
69- req . on ( 'error' , function ( e ) {
69+ req . on ( 'error' , function ( error ) {
7070 process . stdout . write ( "Error" ) ;
7171 process . stdout . write ( endOfLine ) ;
7272
73- if ( e ) {
74- process . stdout . write ( e . toString ( ) ) ;
73+ if ( error ) {
74+ process . stdout . write ( error . toString ( ) ) ;
75+ process . stdout . write ( endOfLine ) ;
7576 }
7677
7778 process . exit ( - 1 ) ;
Original file line number Diff line number Diff line change 11var commander = require ( "commander" ) ;
22var package = require ( '../../package.json' )
3+ var endOfLine = require ( 'os' ) . EOL ;
34var ApiWrapper = require ( '../api' )
45
56commander
67 . version ( package . version )
78 . parse ( process . argv ) ;
89
9- var apiWrapper = new ApiWrapper ( ) ;
10+ try {
11+ var apiWrapper = new ApiWrapper ( ) ;
12+
13+ apiWrapper . verifyUser ( function ( error , result ) {
14+ if ( error ) {
15+ process . stdout . write ( "Error" ) ;
16+ process . stdout . write ( error ) ;
17+ process . exit ( ) ;
18+ }
19+ else {
20+ process . stdout . write ( "Success" ) ;
21+ process . stdout . write ( endOfLine ) ;
22+ process . stdout . write ( result ) ;
23+ process . exit ( ) ;
24+ }
25+ } ) ;
26+ }
27+ catch ( error ) {
28+ process . stdout . write ( "Error" ) ;
29+ process . stdout . write ( endOfLine ) ;
1030
11- apiWrapper . verifyUser ( function ( error , result ) {
1231 if ( error ) {
13- process . stdout . write ( error ) ;
14- process . exit ( - 1 ) ;
15- }
16- else {
17- process . stdout . write ( result ) ;
18- process . exit ( ) ;
32+ process . stdout . write ( error . toString ( ) ) ;
33+ process . stdout . write ( endOfLine ) ;
1934 }
20- } ) ;
35+
36+ process . exit ( ) ;
37+ }
You can’t perform that action at this time.
0 commit comments