Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bonita
bonita-ui-designer-sdk
Commits
018aa24e
Commit
018aa24e
authored
Apr 07, 2021
by
Jerome Cambon
Browse files
Improved CLI parameters checking
parent
db83eb16
Changes
1
Hide whitespace changes
Inline
Side-by-side
custom-widget-builder/src/starter.ts
View file @
018aa24e
...
...
@@ -24,13 +24,14 @@ let params = process.argv.slice(2);
let
wcFile
=
params
[
0
];
if
(
!
wcFile
)
{
usage
();
process
.
exit
(
1
);
}
let
outputDir
=
"
.
"
;
for
(
let
param
of
params
)
{
if
(
param
.
startsWith
(
"
outputDir
"
))
{
outputDir
=
getParameter
(
param
);
if
(
params
.
length
>
1
)
{
let
outputParam
=
params
[
1
];
if
(
params
.
length
>
2
||
!
outputParam
.
startsWith
(
"
outputDir=
"
))
{
usage
();
}
outputDir
=
getParameter
(
outputParam
);
}
console
.
log
(
`Generating widget for
${
wcFile
}
...\n`
);
...
...
@@ -42,4 +43,5 @@ function getParameter(param: string): any {
function
usage
()
{
console
.
log
(
"
Usage: cwb <web component source file> [outputDir=<directory>]
"
);
process
.
exit
(
1
);
}
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