diff --git a/src/icon-packs/pack-manager.ts b/src/icon-packs/pack-manager.ts index 2145aba..38cd9a5 100644 --- a/src/icon-packs/pack-manager.ts +++ b/src/icon-packs/pack-manager.ts @@ -25,7 +25,7 @@ import { } from "./utils"; const CUSTOM_ICON_PATH = "/icons.json"; -const CUSTOM_ICON_DIR = "themes/icons"; +const CUSTOM_ICON_DIR = "icons"; export default class PackManager extends Events { private _customIcons = new Map(); @@ -130,6 +130,10 @@ export default class PackManager extends Events { private _loaded = false; async loadCustomIcons(): Promise { if (this._loaded) return; + if (!(await this.vault.adapter.exists(this.customIconsDir))) { + await this.vault.adapter.mkdir(this.customIconsDir); + return; + } const iconlist = await this.vault.adapter.list(this.customIconsDir); let info; diff --git a/src/modules/json-to-svg.ts b/src/modules/json-to-svg.ts index 81431a8..e6547c2 100644 --- a/src/modules/json-to-svg.ts +++ b/src/modules/json-to-svg.ts @@ -37,7 +37,8 @@ const tryUpdateIcons = async (plugin: IconSC) => { plugin.settings.isMigrated = true; await plugin.saveSettings(); new Notice( - "Icon update complete, you can now find icon files in .obsidian/themes/icons", + "Icon update complete, you can now find icon files in " + + plugin.packManager.customIconsDir, ); } catch (error) { new Notice("Failed to update icons, check console for more details");