Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 21, 2023
1 parent 98b2077 commit e7af457
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/renderer/src/progress/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { merge } from "../stories/pages/utils.js";
import { updateAppProgress, updateFile } from "./update.js";
import { updateURLParams } from "../../utils/url.js";

import * as operations from './operations'
import * as operations from "./operations";

export * from "./update";

Expand Down Expand Up @@ -124,7 +124,7 @@ export const remove = async (name) => {
focusCancel: true,
});

if (result.isConfirmed) return operations.remove(name)
if (result.isConfirmed) return operations.remove(name);

return false;
};
Expand Down
27 changes: 13 additions & 14 deletions src/renderer/src/progress/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@ import { joinPath } from "../globals";
import { conversionSaveFolderPath, guidedProgressFilePath, stubSaveFolderPath } from "../dependencies/simple";
import { fs } from "../electron";


export const remove = (name) => {
//Get the path of the progress file to delete
const progressFilePathToDelete = joinPath(guidedProgressFilePath, name + ".json");
//Get the path of the progress file to delete
const progressFilePathToDelete = joinPath(guidedProgressFilePath, name + ".json");

//delete the progress file
if (fs) fs.unlinkSync(progressFilePathToDelete);
else localStorage.removeItem(progressFilePathToDelete);
//delete the progress file
if (fs) fs.unlinkSync(progressFilePathToDelete);
else localStorage.removeItem(progressFilePathToDelete);

if (fs) {
// delete default stub location
fs.rmSync(joinPath(stubSaveFolderPath, name), { recursive: true, force: true });
if (fs) {
// delete default stub location
fs.rmSync(joinPath(stubSaveFolderPath, name), { recursive: true, force: true });

// delete default conversion location
fs.rmSync(joinPath(conversionSaveFolderPath, name), { recursive: true, force: true });
}
// delete default conversion location
fs.rmSync(joinPath(conversionSaveFolderPath, name), { recursive: true, force: true });
}

return true;
}
return true;
};
2 changes: 0 additions & 2 deletions tests/progress.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ test('pipeline renaming works', () => rename(renameName, initialName))

// delete pipeline
test('pipeline deletion works', () => remove(renameName))


0 comments on commit e7af457

Please sign in to comment.