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 May 29, 2024
1 parent 895ffac commit 77c8770
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,12 @@ export class GuidedPathExpansionPage extends Page {
if (value.split(".").length > 1) entry.file_path = value;
else entry.folder_path = value;

const results = await run(
`neuroconv/locate`,
{ [interfaceName]: entry },
{ swal: false }
).catch((error) => {
this.notify(error.message, "error");
throw error;
});
const results = await run(`neuroconv/locate`, { [interfaceName]: entry }, { swal: false }).catch(
(error) => {
this.notify(error.message, "error");
throw error;
}
);

const resolved = [];

Expand All @@ -434,8 +432,7 @@ export class GuidedPathExpansionPage extends Page {
return [
{
message: html` <h4 style="margin: 0;">
<span style="margin-right: 7px;"></span>Source Files Found for
${interfaceName}
<span style="margin-right: 7px;"></span>Source Files Found for ${interfaceName}
</h4>
<small>${base_directory}</small>
<small
Expand Down
14 changes: 7 additions & 7 deletions src/electron/frontend/core/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import paths from "../../../paths.config.json" assert { type: "json" };

import supportedInterfaces from "../../../supported_interfaces.json" assert { type: "json" };

export const isTestEnvironment = globalThis?.process?.env?.VITEST
export const isTestEnvironment = globalThis?.process?.env?.VITEST;

export const joinPath = (...args) => (path ? path.join(...args) : args.filter((str) => str).join("/"));

Expand All @@ -23,19 +23,19 @@ const root = isTestEnvironment ? joinPath(paths.root, ".test") : paths.root;

export const homeDirectory = os.homedir();

export const appDirectory = joinPath(homeDirectory, root)
export const appDirectory = joinPath(homeDirectory, root);

export const guidedProgressFilePath = joinPath(appDirectory, ...paths.subfolders.progress)
export const guidedProgressFilePath = joinPath(appDirectory, ...paths.subfolders.progress);

export const previewSaveFolderPath = joinPath(appDirectory, ...paths.subfolders.preview)
export const conversionSaveFolderPath = joinPath(appDirectory, ...paths.subfolders.conversions)
export const previewSaveFolderPath = joinPath(appDirectory, ...paths.subfolders.preview);
export const conversionSaveFolderPath = joinPath(appDirectory, ...paths.subfolders.conversions);

export const testDataFolderPath = joinPath(appDirectory, ...paths.subfolders.testdata)
export const testDataFolderPath = joinPath(appDirectory, ...paths.subfolders.testdata);

// Encryption
const IV_LENGTH = 16;
const KEY_LENGTH = 32;
export const ENCRYPTION_KEY = Buffer.concat([Buffer.from(appDirectory), Buffer.alloc(KEY_LENGTH)], KEY_LENGTH)
export const ENCRYPTION_KEY = Buffer.concat([Buffer.from(appDirectory), Buffer.alloc(KEY_LENGTH)], KEY_LENGTH);

export const ENCRYPTION_IV = crypto.randomBytes(IV_LENGTH);

Expand Down
3 changes: 1 addition & 2 deletions src/electron/frontend/core/progress/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const rename = (newDatasetName, previousDatasetName) => {
const oldProgressFilePath = `${guidedProgressFilePath}/${previousDatasetName}.json`;
const newProgressFilePath = `${guidedProgressFilePath}/${newDatasetName}.json`;
fs.renameSync(oldProgressFilePath, newProgressFilePath);

} else throw new Error("No previous project name provided");
};

Expand Down Expand Up @@ -53,7 +52,7 @@ export const updateFile = (projectName, callback) => {

var guidedFilePath = joinPath(guidedProgressFilePath, projectName + ".json");

console.log(guidedProgressFilePath)
console.log(guidedProgressFilePath);

// Save the file through the available mechanisms
if (!fs.existsSync(guidedProgressFilePath)) fs.mkdirSync(guidedProgressFilePath, { recursive: true }); //create progress folder if one does not exist
Expand Down

0 comments on commit 77c8770

Please sign in to comment.