diff --git a/.bauke/scripts/bulk/bulk.ts b/.bauke/scripts/bulk/bulk.ts index 0c136d4..df4b217 100644 --- a/.bauke/scripts/bulk/bulk.ts +++ b/.bauke/scripts/bulk/bulk.ts @@ -1,10 +1,12 @@ import { Command } from "../dependencies.ts"; +import { moveCommand } from "./move.ts"; import { runCommand } from "./run.ts"; async function main(): Promise { await new Command() .name("bulk") .description("Bulk doer of things.") + .command("move", moveCommand) .command("run", runCommand) .parse(Deno.args); } diff --git a/.bauke/scripts/bulk/move.ts b/.bauke/scripts/bulk/move.ts new file mode 100644 index 0000000..e2a2dd9 --- /dev/null +++ b/.bauke/scripts/bulk/move.ts @@ -0,0 +1,33 @@ +import { Command, prompt } from "../dependencies.ts"; + +export const moveCommand = new Command() + .name("move") + .description("Interactively move a group of files.") + .option( + "-d, --directory ", + "Directories to include files from.", + { + collect: true, + }, + ) + .action(async ({ + directory, + }) => { + await actionHandler({ directories: directory ?? [] }); + }); + +async function actionHandler( + options: { + directories: string[]; + }, +): Promise { + for (const directory of options.directories) { + for await (const file of Deno.readDir(directory)) { + if (!file.isFile) { + continue; + } + + console.log(file); + } + } +}