Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
c6ae337d
Commit
c6ae337d
authored
Mar 21, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added parser options - defined first options -c and -h
parent
27568418
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
4 deletions
+49
-4
debomatic-webui/lib/config.js
debomatic-webui/lib/config.js
+12
-4
debomatic-webui/lib/parser.js
debomatic-webui/lib/parser.js
+37
-0
No files found.
debomatic-webui/lib/config.js
View file @
c6ae337d
...
...
@@ -117,12 +117,20 @@ function _merge(object1, object2) {
}
try
{
user_config
=
require
(
'
../user.config.js
'
)
var
Parser
=
require
(
'
./parser.js
'
)
var
parser
=
new
Parser
()
var
user_config
=
parser
.
getUserConfig
()
if
(
user_config
)
{
console
.
log
(
"
Reading user configutation ...
"
)
config
=
_merge
(
config
,
user_config
)
config
=
_merge
(
config
,
require
(
user_config
))
}
else
{
console
.
log
(
"
No user config specified. Using global settings.
"
)
}
}
catch
(
err
)
{
if
(
err
.
code
==
'
MODULE_NOT_FOUND
'
)
{
console
.
log
(
"
User configutation not found. Using global settings.
"
)
console
.
log
(
"
File %s not found.
"
,
user_config
)
process
.
exit
(
1
)
}
else
{
console
.
error
(
"
Error reading user configutation
"
,
err
);
...
...
debomatic-webui/lib/parser.js
0 → 100644
View file @
c6ae337d
function
Parser
()
{
var
args
=
process
.
argv
.
slice
(
2
);
var
help
=
function
()
{
console
.
log
(
"
\
Usage: %s [-c config]
\n\
-h print this help
\n\
-c set user configuration file
"
,
process
.
argv
[
1
].
split
(
'
/
'
).
pop
());
process
.
exit
(
0
);
}
this
.
getUserConfig
=
function
()
{
var
configFile
=
null
;
args
.
forEach
(
function
(
val
,
index
)
{
if
(
val
==
'
-c
'
)
{
configFile
=
args
[
index
+
1
]
return
}
})
if
(
configFile
)
return
process
.
cwd
()
+
'
/
'
+
configFile
;
else
return
null
}
args
.
forEach
(
function
(
val
,
index
)
{
if
(
val
==
'
-h
'
)
{
help
()
}
})
}
module
.
exports
=
Parser
\ No newline at end of file
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