Skip to content

Commit

Permalink
Only load node dependent library if in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
oleeskild committed Oct 3, 2023
1 parent 45b550c commit 2c5aab8
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import PublishStatusManager from "src/publisher/PublishStatusManager";
import ObsidianFrontMatterEngine from "src/publishFile/ObsidianFrontMatterEngine";
import DigitalGardenSiteManager from "src/repositoryConnection/DigitalGardenSiteManager";
import { DigitalGardenSettingTab } from "./src/views/DigitalGardenSettingTab";
import { generateGardenSnapshot } from "./src/test/snapshot/generateGardenSnapshot";
import dotenv from "dotenv";
import Logger from "js-logger";
import { PublishFile } from "./src/publishFile/PublishFile";
Expand Down Expand Up @@ -164,13 +163,22 @@ export default class DigitalGarden extends Plugin {
this.settings,
);

this.addCommand({
id: "generate-garden-snapshot",
name: "Generate Garden Snapshot",
callback: async () => {
await generateGardenSnapshot(this.settings, publisher);
},
});
import("./src/test/snapshot/generateGardenSnapshot")
.then((snapshotGen) => {
this.addCommand({
id: "generate-garden-snapshot",
name: "Generate Garden Snapshot",
callback: async () => {
await snapshotGen.generateGardenSnapshot(
this.settings,
publisher,
);
},
});
})
.catch((e) => {
Logger.error("Unable to load generateGardenSnapshot", e);
});
}

this.addCommand({
Expand Down

0 comments on commit 2c5aab8

Please sign in to comment.