Skip to content

Commit

Permalink
fix: add target path validation and notice (#44)
Browse files Browse the repository at this point in the history
fix: add target path validation
  • Loading branch information
songkg7 authored Mar 7, 2023
1 parent ffc2665 commit 7c968ae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/settings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App, PluginSettingTab, Setting } from "obsidian";
import { App, Notice, PluginSettingTab, Setting } from "obsidian";
import O2Plugin from "./main";

export interface O2PluginSettings {
Expand Down Expand Up @@ -64,7 +64,11 @@ export class JekyllSetting implements O2PluginSettings {
}

afterPropertiesSet(): boolean {
return this._jekyllPath != '';
if (this._jekyllPath === '') {
new Notice('Jekyll path is not set.', 5000);
return false;
}
return true;
}

// FIXME: As I know, abstraction is better solution but this is something weird.
Expand Down

0 comments on commit 7c968ae

Please sign in to comment.