Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scilla-declare-generator
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
scilla-declare-generator
Commits
923167cf
Commit
923167cf
authored
Apr 29, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exit code
parent
5ab9ab60
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
cli-wrapper.js
bin/cli-wrapper.js
+2
-2
cli.js
bin/cli.js
+8
-2
No files found.
bin/cli-wrapper.js
View file @
923167cf
...
@@ -10,7 +10,7 @@ const {generateDeclareMap} = require('../src/index');
...
@@ -10,7 +10,7 @@ const {generateDeclareMap} = require('../src/index');
exports
.
execute
=
async
function
(
program
)
{
exports
.
execute
=
async
function
(
program
)
{
if
(
!
program
.
input
)
{
if
(
!
program
.
input
)
{
console
.
warn
(
'parameter is incorrect'
);
console
.
warn
(
'parameter is incorrect'
);
process
.
exit
(
1
)
;
return
1
;
}
}
const
componentsPath
=
program
.
projectPath
||
path
.
join
(
os
.
homedir
(),
'.scilla'
,
'components'
);
const
componentsPath
=
program
.
projectPath
||
path
.
join
(
os
.
homedir
(),
'.scilla'
,
'components'
);
...
@@ -44,7 +44,7 @@ exports.execute = async function (program) {
...
@@ -44,7 +44,7 @@ exports.execute = async function (program) {
if
(
Object
.
keys
(
missingDependencies
).
length
>
0
)
{
if
(
Object
.
keys
(
missingDependencies
).
length
>
0
)
{
console
.
warn
(
JSON
.
stringify
(
missingDependencies
,
null
,
'
\
t'
));
console
.
warn
(
JSON
.
stringify
(
missingDependencies
,
null
,
'
\
t'
));
process
.
exit
(
2
)
;
return
2
;
}
}
fs
.
writeJsonSync
(
outputFile
,
declareMap
);
fs
.
writeJsonSync
(
outputFile
,
declareMap
);
...
...
bin/cli.js
View file @
923167cf
...
@@ -16,7 +16,13 @@ program
...
@@ -16,7 +16,13 @@ program
.
option
(
'-v, --verbose [boolean]'
,
'verbose mode'
,
false
)
.
option
(
'-v, --verbose [boolean]'
,
'verbose mode'
,
false
)
.
parse
(
process
.
argv
);
.
parse
(
process
.
argv
);
execute
(
program
).
catch
(
e
=>
{
execute
(
program
).
then
(
code
=>
{
if
(
code
>
0
){
process
.
exit
(
code
)
}
}
).
catch
(
e
=>
{
console
.
error
(
e
);
console
.
error
(
e
);
process
.
exit
(
2
);
process
.
exit
(
99
);
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment