Skip to content

Commit d0e8996

Browse files
committed
feat(main): sync working dir if it does not exist.
1 parent b62d9fe commit d0e8996

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/main.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -836,10 +836,17 @@ export default class InvioPlugin extends Plugin {
836836
// Add custom icon for root dir
837837
setTimeout(() => {
838838
if (this.settings.localWatchDir) {
839-
this.ga.trace('boot_project', {
840-
dirname: this.settings.localWatchDir
841-
});
842-
this.switchWorkingDir(this.settings.localWatchDir);
839+
this.app.vault.adapter.exists(this.settings.localWatchDir)
840+
.then(dirWatching => {
841+
if (dirWatching) {
842+
this.ga.trace('boot_project', {
843+
dirname: this.settings.localWatchDir
844+
});
845+
this.switchWorkingDir(this.settings.localWatchDir);
846+
} else {
847+
Utils.mockLocaleFile(this)
848+
}
849+
})
843850
} else {
844851
new Notice(
845852
t("syncrun_no_watchdir_err")

0 commit comments

Comments
 (0)