diff options
Diffstat (limited to 'bpkg/utility.cxx')
-rw-r--r-- | bpkg/utility.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/bpkg/utility.cxx b/bpkg/utility.cxx index 40ae02c..b179f63 100644 --- a/bpkg/utility.cxx +++ b/bpkg/utility.cxx @@ -255,8 +255,8 @@ namespace bpkg } } - void - mv (const dir_path& from, const dir_path& to) + bool + mv (const dir_path& from, const dir_path& to, bool ie) { if (verb >= 3) text << "mv " << from << ' ' << to; // Prints trailing slashes. @@ -267,8 +267,16 @@ namespace bpkg } catch (const system_error& e) { - fail << "unable to move directory " << from << " to " << to << ": " << e; + error << "unable to move directory " << from << " to " << to << ": " + << e; + + if (ie) + return false; + + throw failed (); } + + return true; } dir_path |