feat: add list files command

This commit is contained in:
DecDuck
2025-05-26 15:02:28 +10:00
parent 6b5356627a
commit 072a1584a0
2 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@drop-oss/droplet",
"version": "1.0.0",
"version": "1.1.0",
"main": "index.js",
"types": "index.d.ts",
"napi": {
@ -42,6 +42,6 @@
},
"packageManager": "yarn@4.7.0",
"repository": {
"url": "https://github.com/Drop-OSS/droplet"
"url": "git+https://github.com/Drop-OSS/droplet.git"
}
}

View File

@ -110,3 +110,11 @@ pub fn has_backend_for_path(path: String) -> bool {
has_backend
}
#[napi]
pub fn list_files(path: String) -> Vec<String> {
let path = Path::new(&path);
let backend = create_backend_for_path(path).unwrap();
let files = backend.list_files(path);
files.into_iter().map(|e| e.relative_filename).collect()
}