You've already forked AstralRinth
forked from didirus/AstralRinth
Finish launching modded versions of Minecraft
This commit is contained in:
17
theseus/src/util.rs
Normal file
17
theseus/src/util.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::{env, io};
|
||||
|
||||
use path_clean::PathClean;
|
||||
|
||||
pub fn absolute_path(path: impl AsRef<Path>) -> io::Result<PathBuf> {
|
||||
let path = path.as_ref();
|
||||
|
||||
let absolute_path = if path.is_absolute() {
|
||||
path.to_path_buf()
|
||||
} else {
|
||||
env::current_dir()?.join(path)
|
||||
}
|
||||
.clean();
|
||||
|
||||
Ok(absolute_path)
|
||||
}
|
||||
Reference in New Issue
Block a user