summaryrefslogtreecommitdiff
path: root/src/fs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs.rs')
-rw-r--r--src/fs.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fs.rs b/src/fs.rs
index 9191d5373..28f269f59 100644
--- a/src/fs.rs
+++ b/src/fs.rs
@@ -34,3 +34,13 @@ pub fn mkdir(path: &Path) -> std::io::Result<()> {
}
})
}
+
+pub fn normalize_path(path: &Path) -> String {
+ let s = String::from(path.to_str().unwrap());
+ if cfg!(windows) {
+ // TODO This isn't correct. Probbly should iterate over components.
+ s.replace("\\", "/")
+ } else {
+ s
+ }
+}