ft-cli 0.1.0

ft-cli is a tool for syncing a git repo or a local folder to a FifthTry account
1
2
3
4
5
6
7
8
9
10
11
pub fn to_document_id(path: &str, root_dir: &str, collection_id: &str) -> std::path::PathBuf {
    let path_without_root = std::path::Path::new(path)
        .strip_prefix(root_dir)
        .unwrap_or_else(|_| {
            panic!(
                "path `{}` does not start with root_dir `{}`",
                path, root_dir
            )
        });
    std::path::PathBuf::from(collection_id).join(&path_without_root)
}