Fix folder param in b_manage

This commit is contained in:
2025-05-14 12:51:56 +02:00
parent d6603dd638
commit b639a2d79a
4 changed files with 12 additions and 7 deletions

View File

@@ -59,7 +59,9 @@ install: ## Copy binary files to bin folder
@echo "*******************************************"
@for item in $(app_targets); do \
echo ">>> Copying $$item" ; \
cp $(f_release)/src/$$item $(dest) ; \
cp $(f_release)/src/$$item $(dest) || { \
echo "*** Error copying $$item" ; \
} ; \
done
dependency: ## Create a dependency graph diagram of the project (build/dependency.png)

View File

@@ -119,6 +119,9 @@ int main(int argc, char** argv)
manageArguments(program, argc, argv);
std::string model = program.get<std::string>("model");
std::string path = program.get<std::string>("folder");
if (path.back() != '/') {
path += '/';
}
std::string score = program.get<std::string>("score");
std::string platform = program.get<std::string>("platform");
bool complete = program.get<bool>("complete");

View File

@@ -18,8 +18,8 @@ namespace platform {
const std::string STATUS_OK = "Ok.";
const std::string STATUS_COLOR = Colors::GREEN();
ManageScreen::ManageScreen(const std::string path, int rows, int cols, const std::string& model, const std::string& score, const std::string& platform, bool complete, bool partial, bool compare) :
rows{ rows }, cols{ cols }, complete{ complete }, partial{ partial }, compare{ compare }, didExcel(false), results(ResultsManager(path, model, score, platform, complete, partial))
ManageScreen::ManageScreen(const std::string path_, int rows, int cols, const std::string& model, const std::string& score, const std::string& platform, bool complete, bool partial, bool compare) :
path{ path_ }, rows{ rows }, cols{ cols }, complete{ complete }, partial{ partial }, compare{ compare }, didExcel(false), results(ResultsManager(path_, model, score, platform, complete, partial))
{
results.load();
openExcel = false;
@@ -329,11 +329,11 @@ namespace platform {
return;
}
// Remove the old result file
std::string oldFile = Paths::results() + results.at(index).getFilename();
std::string oldFile = path + results.at(index).getFilename();
std::filesystem::remove(oldFile);
// Actually change the model
results.at(index).setModel(newModel);
results.at(index).save();
results.at(index).save(path);
int newModelSize = static_cast<int>(newModel.size());
if (newModelSize > maxModel) {
maxModel = newModelSize;
@@ -583,7 +583,7 @@ namespace platform {
getline(std::cin, newTitle);
if (!newTitle.empty()) {
results.at(index).setTitle(newTitle);
results.at(index).save();
results.at(index).save(path);
list("Title changed to " + newTitle, Colors::GREEN());
break;
}

View File

@@ -59,7 +59,7 @@ namespace platform {
std::vector<Paginator> paginator;
ResultsManager results;
lxw_workbook* workbook;
std::string excelFileName;
std::string path, excelFileName;
};
}
#endif