mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-21 11:26:15 +02:00
docs: use join in readDir documentation example (#1500)
This commit is contained in:
@@ -641,6 +641,7 @@ interface DirEntry {
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { readDir, BaseDirectory } from '@tauri-apps/plugin-fs';
|
||||
* import { join } from '@tauri-apps/api/path';
|
||||
* const dir = "users"
|
||||
* const entries = await readDir('users', { baseDir: BaseDirectory.App });
|
||||
* processEntriesRecursive(dir, entries);
|
||||
@@ -648,7 +649,7 @@ interface DirEntry {
|
||||
* for (const entry of entries) {
|
||||
* console.log(`Entry: ${entry.name}`);
|
||||
* if (entry.isDirectory) {
|
||||
* const dir = parent + entry.name;
|
||||
* const dir = await join(parent, entry.name);
|
||||
* processEntriesRecursive(dir, await readDir(dir, { baseDir: BaseDirectory.App }))
|
||||
* }
|
||||
* }
|
||||
|
||||
Reference in New Issue
Block a user