-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8448cc
commit 6bfe4de
Showing
4 changed files
with
44 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { join } from "./deps.ts"; | ||
|
||
export async function getNestedDirectories(dirname: string): Promise<string[]> { | ||
let items: string[] = []; | ||
for await (const item of Deno.readDir(dirname)) { | ||
if (item.isDirectory) { | ||
items.push(item.name); | ||
const jp = join(dirname, item.name); | ||
let dirs = await getNestedDirectories(jp); | ||
dirs = dirs.map((subdir) => join(item.name, subdir)); | ||
items = items.concat(dirs); | ||
} | ||
} | ||
return items; | ||
} |