snakepipe 2.2.0

A snake game based on stdin/stdout following unix philosophy
Documentation
1
2
3
4
5
6
7
8
9
use std::path::PathBuf;

pub fn resolve_path(path: PathBuf) -> std::io::Result<PathBuf> {
    if path.is_absolute() {
        return Ok(path);
    }
    let current_dir = std::env::current_dir()?;
    std::fs::canonicalize(format!("{}/{}", current_dir.display(), path.display()))
}