dehydrate release v8

This commit is contained in:
Your Name 2025-05-21 21:29:19 +12:00
parent 80c62d827a
commit 8bab3d0426
3 changed files with 5 additions and 3 deletions

View File

@ -1 +1 @@
static const char *VERSION = "7";
static const char *VERSION = "8";

View File

@ -109,6 +109,8 @@ static bool _recreate_file_(const std::filesystem::path& outpath, uint64_t file_
}
if (needs_write) {
bool existed = fs::exists(outpath);
fs::create_directories(outpath.parent_path());
std::ofstream out(outpath, std::ios::binary);
out.write(reinterpret_cast<const char*>(filedata), filedata_len);
@ -116,7 +118,7 @@ static bool _recreate_file_(const std::filesystem::path& outpath, uint64_t file_
// Set the file permissions
fs::permissions(outpath, file_perms);
if (!fs::exists(outpath)) {
if (!existed) {
std::cout << "[dehydrate] " << outpath.filename() << ": created\n";
} else {
std::cout << "[dehydrate] " << outpath.filename() << ": updated (hash changed)\n";

View File

@ -38,7 +38,7 @@ $TEST_DIR/testexe
# third time just two files changed
echo "----------------------------------------"
echo "Should be two changes: generator.cpp and hash.cpp"
echo "Should see: hash.cpp - updated, and generator.cpp - created."
rm $TEST_DIR/temp/generator.cpp
echo "whee!" >> $TEST_DIR/temp/hash.cpp