mirror of
https://github.com/Drop-OSS/droplet.git
synced 2025-11-26 22:43:47 +10:00
feat: add list files command
This commit is contained in:
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user