Skip to content

Commit

Permalink
Fixed error message on checkpoints delete attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
MaelImhof committed Aug 4, 2024
1 parent beaf9ff commit 4b653a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/jupyter-obsidian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { EmbeddedJupyterView } from "./ui/jupyter-view";
import { DEFAULT_SETTINGS, JupyterSettings, JupyterSettingsTab, OpenCreatedNotebook, PythonExecutableType } from "./jupyter-settings";
import { JupyterModal } from "./ui/jupyter-modal";
import { UpdateModal } from "./ui/jupyter-update-modal";
import { rmdirSync } from "fs";
import { existsSync, rmdirSync } from "fs";
import { JupyterAbstractPath } from "./utils/jupyter-path";

export default class JupyterNotebookPlugin extends Plugin {
Expand Down Expand Up @@ -551,6 +551,11 @@ export default class JupyterNotebookPlugin extends Plugin {
return;
}

// Check that the folder exists
if (!existsSync(checkpointsFolder.getAbsolutePath())) {
return;
}

// If the root checkpoints folder was found, delete it
if (!this.settings.deleteCheckpoints || this.settings.moveCheckpointsToTrash) {
// Even if the setting is disabled, we do not want to keep the
Expand Down

0 comments on commit 4b653a1

Please sign in to comment.