devalang_wasm/tools/cli/io/mod.rs
1#![cfg(feature = "cli")]
2
3use anyhow::Result;
4use std::path::{Path, PathBuf};
5
6pub struct ProjectPaths;
7
8impl ProjectPaths {
9 pub fn resolve(entry: Option<&Path>) -> Result<PathBuf> {
10 let path = entry
11 .map(PathBuf::from)
12 .unwrap_or_else(|| std::env::current_dir().expect("current dir"));
13 Ok(path)
14 }
15}