Toggle navigation
Toggle navigation
This project
Loading...
Sign in
arcs
/
arcs.js
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
3
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Yves Didier
2023-08-19 13:45:57 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b1aa70cfca5eab068c589dda36a33db05607d1a6
b1aa70cf
1 parent
d5e49781
added options to arcsm
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
2 deletions
tools/arcsm.js
tools/arcsm.js
View file @
b1aa70c
...
...
@@ -23,12 +23,14 @@ const usage = function(idx) {
'Usage:'
,
path
.
basename
(
process
.
argv
[
0
]),
path
.
basename
(
process
.
argv
[
1
]),
"[-r repository_location] [-h] [-l] [-s keyword]"
"[-r repository_location] [-h] [-l] [-s keyword]
[-i library_name] [-c library_name]
"
);
console
.
log
(
"\t-h or --help displays usage"
);
console
.
log
(
"\t-r <repository location> sets the location of the repository json file or url"
);
console
.
log
(
"\t-l lists available component libraries"
);
console
.
log
(
"\t-s <keyword> searches for components with the given keyword"
);
console
.
log
(
"\t-i <library name> installs the given library or component"
);
console
.
log
(
"\t-c <library name> checks the given library or component and install its dependencies"
);
process
.
exit
(
0
);
return
0
;
};
...
...
@@ -119,6 +121,34 @@ const processRecipe = function(recipe, projectPath) {
fs
.
writeFileSync
(
outPath
,
outContents
,
'utf8'
);
};
const
solveLibraryName
=
function
(
name
)
{
};
const
check
=
function
(
name
)
{
let
components
=
repository
.
components
;
let
libraries
=
repository
.
libraries
;
let
library
=
(
libraries
[
name
]?
name
:
null
)
||
components
[
name
]?.
library
;
let
lib
=
libraries
[
library
];
if
(
lib
===
undefined
)
{
return
;
}
if
(
lib
.
dependencies
!==
undefined
)
{
console
.
log
(
"Installing dependencies"
);
lib
.
dependencies
.
forEach
((
dep
)
=>
{
execSync
(
`npm install
${
dep
}
`
,
{
stdio
:
'inherit'
});
});
}
if
(
lib
.
recipes
!==
undefined
)
{
console
.
log
(
"Processing recipes"
)
lib
.
recipes
.
forEach
((
recipe
)
=>
{
processRecipe
(
recipe
,
project
);
});
}
}
const
install
=
function
(
name
)
{
let
components
=
repository
.
components
;
let
libraries
=
repository
.
libraries
;
...
...
@@ -202,8 +232,10 @@ const helpers ={
'-i'
:
function
(
idx
)
{
actions
.
push
([
install
,
[
process
.
argv
[
idx
+
1
]]]);
return
1
;
},
'-c'
:
function
(
idx
)
{
actions
.
push
([
check
,
[
process
.
argv
[
idx
+
1
]]]);
}
}
/** list of helpers that are needed
...
...
@@ -212,6 +244,7 @@ const helpers ={
* -i: install library or component
* -l: list libraries
* -r: repository url
* -c: check dependencies for component or library
*
*/
...
...
Please
register
or
login
to post a comment