Update modals & commands locations

This commit is contained in:
Unarray 2023-08-26 18:53:31 +02:00
parent 5dd1304a4e
commit 18ee5cea75
4 changed files with 9 additions and 5 deletions

View file

@ -1,5 +1,5 @@
import type { Command, Editor } from "obsidian";
import { GenerateTree as GenerateTreeModal } from "#/modals";
import { GenerateTree as GenerateTreeModal } from "#/modals/generate-tree";
import FileTreeGenerator from "#/FileTreeGenerator";
export class GenerateTree implements Command {

View file

@ -113,10 +113,14 @@ export class GenerateTree extends Modal {
const selectedPath = dialogResponse.filePaths[0];
const removePath = selectedPath.substring(0, selectedPath.lastIndexOf(sep) + sep.length);
const regex = beginningString(removePath);
const files = filter(
(await getFiles(selectedPath)).map(file => file.replace(regex, "")),
SettingsTab.getInstance().settings.ignore
);
const rowFiles = (await getFiles(selectedPath)).map(file => file.replace(regex, ""));
let files: string[];
if (this.useIgnore) {
files = filter(rowFiles, SettingsTab.getInstance().settings.ignore);
} else {
files = rowFiles;
}
showNotice = false;
notice.hide();