mirror of
https://github.com/modrinth/code.git
synced 2026-09-02 13:05:50 +00:00
Finish launching modded versions of Minecraft
This commit is contained in:
@@ -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