decomp: more descriptive error messages (#1178)

This commit is contained in:
Tyler Wilding
2022-02-16 22:12:38 -05:00
committed by GitHub
parent 78e5fc0deb
commit 74d0025974
+12 -4
View File
@@ -85,13 +85,21 @@ int main(int argc, char** argv) {
// Verify the in_folder is correct
// TODO - refactor to use ghc::filesystem, cleanup file_util
if (!file_util::file_exists(in_folder) ||
(!config.expected_elf_name.empty() &&
!file_util::file_exists(file_util::combine_path(in_folder, config.expected_elf_name)))) {
printf("Aborting - 'in_folder' does not exist or does not contain the expected files\n");
if (!file_util::file_exists(in_folder)) {
fmt::print("Aborting - 'in_folder' does not exist '{}'\n", in_folder);
return 1;
}
// Warning message if expected ELF isn't found, user could be using bad assets / didn't extract
// the ISO properly
if (!config.expected_elf_name.empty() &&
!file_util::file_exists(file_util::combine_path(in_folder, config.expected_elf_name))) {
fmt::print(
"WARNING - '{}' does not contain the expected ELF file '{}'. Was the ISO extracted "
"properly or is there a version mismatch?\n",
in_folder, config.expected_elf_name);
}
std::vector<std::string> dgos, objs, strs;
for (const auto& dgo_name : config.dgo_names) {
dgos.push_back(file_util::combine_path(in_folder, dgo_name));