nips 970398.1846.57265

nips: a nostr-protocol/nips server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::env;
use std::fs;
use std::io;
use std::path::Path;
use std::path::PathBuf;
pub async fn canonicalize_path(path: &Path) -> io::Result<PathBuf> {
    let absolute_path = if path.is_relative() {
        let current_dir = env::current_dir()?;
        current_dir.join(path)
    } else {
        path.to_path_buf()
    };
    fs::canonicalize(absolute_path)
}