统一处理输入目录

Signed-off-by: fangyunzhong <fangyunzhong2@huawei.com>
This commit is contained in:
fangyunzhong
2023-05-26 02:06:41 +00:00
parent 668a3e7582
commit 915d49ab63
9 changed files with 64 additions and 24 deletions
+15 -1
View File
@@ -50,7 +50,11 @@ uint32_t PackageParser::Parse(int argc, char *argv[])
if (ParseCommand(argc, argv) != RESTOOL_SUCCESS) {
return RESTOOL_ERROR;
}
return CheckParam();
if (CheckParam() != RESTOOL_SUCCESS) {
return RESTOOL_ERROR;
}
AdaptResourcesDirForInput();
return RESTOOL_SUCCESS;
}
const vector<string> &PackageParser::GetInputs() const
@@ -220,6 +224,16 @@ uint32_t PackageParser::AddCachePath(const string& argValue)
return RESTOOL_SUCCESS;
}
// -i input directory, add the resource directory
void PackageParser::AdaptResourcesDirForInput()
{
if (!isFileList_ && !combine_) { // -l and increment compile -i, no need to add resource directory
for (auto &path : inputs_) {
path = FileEntry::FilePath(path).Append(RESOURCES_DIR).GetPath();
}
}
}
uint32_t PackageParser::CheckParam() const
{
if (inputs_.empty() && append_.empty()) {