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
d5b2491b
Commit
d5b2491b
authored
Apr 29, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cli wrapper
parent
92bda91c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
cli-wrapper.js
bin/cli-wrapper.js
+5
-5
cli.js
bin/cli.js
+0
-1
No files found.
bin/cli-wrapper.js
View file @
d5b2491b
...
...
@@ -8,7 +8,7 @@ const fs = require('fs-extra');
const
{
generateDeclareMap
}
=
require
(
'../src/index'
);
exports
.
execute
=
async
function
(
program
)
{
if
(
!
program
.
input
||
!
program
.
output
)
{
if
(
!
program
.
input
)
{
console
.
warn
(
'parameter is incorrect'
);
process
.
exit
(
1
);
}
...
...
@@ -19,6 +19,7 @@ exports.execute = async function (program) {
const
inputFile
=
program
.
input
;
const
inputFileFolder
=
path
.
dirname
(
inputFile
);
const
outputFile
=
path
.
join
(
inputFileFolder
,
'declare.json'
);
const
projectPath
=
process
.
cwd
();
...
...
@@ -28,7 +29,7 @@ exports.execute = async function (program) {
const
result
=
generateDeclareMap
(
tsconfig
,
program
.
input
,
inputFile
,
componentsSrcPath
,
projectPath
,
null
,
...
...
@@ -44,6 +45,5 @@ exports.execute = async function (program) {
process
.
exit
(
2
);
}
fs
.
ensureDirSync
(
path
.
dirname
(
program
.
output
));
fs
.
writeJsonSync
(
program
.
output
,
result
.
declareMap
);
}
fs
.
writeJsonSync
(
outputFile
,
result
.
declareMap
);
};
bin/cli.js
View file @
d5b2491b
...
...
@@ -12,7 +12,6 @@ program
.
version
(
'1.0.3'
)
.
description
(
'scilla declare generator'
)
.
option
(
'-i, --input [string]'
,
'input file'
)
.
option
(
'-o, --output [string]'
,
'output file'
)
.
option
(
'-p, --projectPath [string]'
,
'path of components'
)
.
option
(
'-v, --verbose [boolean]'
,
'verbose mode'
,
false
)
.
parse
(
process
.
argv
);
...
...
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