aboutsummaryrefslogtreecommitdiff
path: root/bdep/utility.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bdep/utility.cxx')
-rw-r--r--bdep/utility.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/bdep/utility.cxx b/bdep/utility.cxx
index 9c8057e..148610b 100644
--- a/bdep/utility.cxx
+++ b/bdep/utility.cxx
@@ -95,6 +95,25 @@ namespace bdep
}
}
+ dir_path&
+ normalize (dir_path& d, const char* what)
+ {
+ try
+ {
+ d.complete ().normalize ();
+ }
+ catch (const invalid_path& e)
+ {
+ fail << "invalid " << what << " directory " << e.path;
+ }
+ catch (const system_error& e)
+ {
+ fail << "unable to obtain current directory: " << e;
+ }
+
+ return d;
+ }
+
bool
exists (const path& f, bool ignore_error)
{