Support tree; Do not enforce LBA source for Overlays

This commit is contained in:
Jaby 2024-01-03 17:45:57 -06:00
parent 0e16ae4a45
commit da6e8e467b
5 changed files with 23 additions and 7 deletions

View File

@ -83,7 +83,7 @@
{
"id": "cargo cmd",
"type":"pickString",
"options": ["build", "check", "update", "clean", "run"],
"options": ["build", "check", "update", "clean", "run", "tree"],
"default": "build",
"description": "cargo command to run"
},

View File

@ -8,9 +8,9 @@ panic = "abort"
[dependencies]
cdtypes = {path = "../cdtypes"}
clap = {version = "*", features = ["derive"]}
colored = "*"
no-comment = "*"
paste = "*"
roxmltree = "*"
clap = {version = "4.4.11", features = ["derive"]}
colored = "2.1.0"
no-comment = "0.0.3"
paste = "1.0.14"
roxmltree = "0.19.0"
tool_helper = {path = "../tool_helper"}

View File

@ -120,7 +120,13 @@ fn load_lba_names(lba_source: PathBuf) -> Result<LBANameVec, Error> {
Ok(file[start..end].to_owned())
}
let file = read_file_to_string(&lba_source)?.chars().without_comments(languages::c()).collect::<String>();
let file_content = {
match read_file_to_string(&lba_source) {
Ok(data) => data,
Err(_) => return Ok(LBANameVec::new())
}
};
let file = file_content.chars().without_comments(languages::c()).collect::<String>();
let file = get_part_of_interest(file, &lba_source)?;
let mut lba_names = Vec::new();

View File

@ -55,4 +55,10 @@ IF %2 == update (
exit /B %ERRORLEVEL%
)
IF %2 == tree (
%wsl%cargo tree
exit /B %ERRORLEVEL%
)
echo "Unkown cargo command "%2" for project "%1"

View File

@ -37,6 +37,10 @@ elif [ $2 = update ]; then
echo "cargo update $1"
$HOME/.cargo/bin/cargo update
exit $?
elif [ $2 = tree ]; then
$HOME/.cargo/bin/cargo tree
exit $?
else
echo "Unkown cargo command $2 for project $1"