From 5877ff53ee44e9c2fa0f3bb5767dd5b88deacf81 Mon Sep 17 00:00:00 2001 From: Unarray <48868686+Unarray@users.noreply.github.com> Date: Wed, 23 Aug 2023 15:44:26 +0200 Subject: [PATCH] Register new `GenerateTree` command --- src/FileTreeGenerator.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/FileTreeGenerator.ts b/src/FileTreeGenerator.ts index ddd02e3..2947fa7 100644 --- a/src/FileTreeGenerator.ts +++ b/src/FileTreeGenerator.ts @@ -1,6 +1,19 @@ +import { GenerateTree } from "#/commands/GenerateTree"; +import type { Command } from "obsidian"; import { Plugin } from "obsidian"; export default class FileTreeGenerator extends Plugin { + onload(): void { + this.addCommands( + new GenerateTree() + ); + } + + public addCommands = (...commands: Command[]): void => { + for (const command of commands) { + this.addCommand(command); + } + }; } \ No newline at end of file