dehydrate release v8
This commit is contained in:
parent
80c62d827a
commit
8bab3d0426
@ -1 +1 @@
|
||||
static const char *VERSION = "7";
|
||||
static const char *VERSION = "8";
|
||||
|
@ -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";
|
||||
|
2
test.sh
2
test.sh
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user