shulkerscript-cli/src/util.rs

10 lines
226 B
Rust
Raw Normal View History

2024-03-27 13:58:09 +01:00
use std::{io, path::Path};
pub fn to_absolute_path(path: &Path) -> io::Result<String> {
Ok(std::fs::canonicalize(path)?
.display()
.to_string()
.trim_start_matches(r"\\?\")
.to_string())
}