-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from YuzukiTsuru/dev
delete files after get size
- Loading branch information
Showing
4 changed files
with
30 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,7 +145,7 @@ void OpenixCard::show_logo() { | |
"| |___ ___ ___|_|_ _| |___ ___ _| |\n" | ||
"| | | . | -_| | |_'_| --| .'| _| . |\n" | ||
"|_____| _|___|_|_|_|_,_|_____|__,|_| |___|\n" | ||
" |_| Version: " << PROJECT_GIT_HASH | ||
" |_| Version: " << PROJECT_GIT_HASH << " Commit: " << PROJECT_VER | ||
<< cc::magenta << | ||
"\nCopyright (c) 2022, YuzukiTsuru <[email protected]>\n" | ||
<< cc::reset << std::endl; | ||
|
@@ -189,8 +189,21 @@ void OpenixCard::unpack_target_image() { | |
std::filesystem::create_directories(temp_file_path); | ||
crypto_init(); | ||
std::cout << cc::cyan; | ||
unpack_image(input_file.c_str(), temp_file_path.c_str(), is_absolute); | ||
auto unpack_img_ret = unpack_image(input_file.c_str(), temp_file_path.c_str(), is_absolute); | ||
std::cout << cc::reset; | ||
|
||
switch (unpack_img_ret) { | ||
case 2: | ||
throw file_open_error(input_file); | ||
case 3: | ||
throw file_size_error(input_file); | ||
case 4: | ||
throw std::runtime_error("Unable to allocate memory for image: "+ input_file); | ||
case 5: | ||
throw file_format_error(input_file); | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
void OpenixCard::dump_and_clean() { | ||
|
@@ -229,5 +242,6 @@ void OpenixCard::get_real_size() { | |
FEX2CFG fex2Cfg(temp_file_path); | ||
auto real_size = fex2Cfg.get_image_real_size(true); | ||
LOG::DATA("The accurate size of image: " + std::to_string(real_size / 1024) + "MB, " + std::to_string(real_size) + "KB"); | ||
std::filesystem::remove_all(temp_file_path); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters