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
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@drop-oss/droplet", "name": "@drop-oss/droplet",
"version": "1.0.0", "version": "1.1.0",
"main": "index.js", "main": "index.js",
"types": "index.d.ts", "types": "index.d.ts",
"napi": { "napi": {
@@ -42,6 +42,6 @@
}, },
"packageManager": "yarn@4.7.0", "packageManager": "yarn@4.7.0",
"repository": { "repository": {
"url": "https://github.com/Drop-OSS/droplet" "url": "git+https://github.com/Drop-OSS/droplet.git"
} }
} }
+8
View File
@@ -110,3 +110,11 @@ pub fn has_backend_for_path(path: String) -> bool {
has_backend 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()
}