resolve

Macro resolve 

Source
macro_rules! resolve {
    ( $( $x:expr ),* ) => { ... };
}
Expand description

Resolves a sequence of paths or path segments into an absolute path.

assert_eq!(&nodejs_path::resolve!("/foo/bar", "./baz"), "/foo/bar/baz");

assert_eq!(&nodejs_path::resolve!("/foo/bar", "/tmp/file/"), "/tmp/file");

assert_eq!(&nodejs_path::resolve!("/home/myself/node", "wwwroot", "static_files/png/", "../gif/image.gif"), "/home/myself/node/wwwroot/static_files/gif/image.gif");

assert_eq!(nodejs_path::resolve!("."), std::env::current_dir().unwrap().to_str().unwrap().to_owned());

assert_eq!(nodejs_path::resolve!(), std::env::current_dir().unwrap().to_str().unwrap().to_owned());