diff --git a/src/electron-main/api/index.ts b/src/electron-main/api/index.ts index 41fc11e25..bc18b9c8f 100644 --- a/src/electron-main/api/index.ts +++ b/src/electron-main/api/index.ts @@ -104,7 +104,7 @@ export const initApi = async (ctx: Context): Promise => { for (const [name, value] of Object.entries(stores)) { // overriding the config file even if it exists - const override = (await value.dest.readable() && name === "config") || undefined; + const overwrite = (await value.dest.readable() && name === "config") || undefined; const srcReadable: boolean | "denied read access" = isSnapPackage ? await (async () => { try { @@ -123,10 +123,10 @@ export const initApi = async (ctx: Context): Promise => { dest: value.dest.file, skip: srcReadable !== true ? srcReadable || "source doesn't exist" - : await value.dest.readable() !== true || override + : await value.dest.readable() !== true || overwrite ? undefined : "destination exists", - override, + overwrite, }; } @@ -155,12 +155,12 @@ export const initApi = async (ctx: Context): Promise => { })()), migrate: ({config, settings, database}) => from((async () => { - for (const {skip, src, dest, override} of [config, settings, database]) { + for (const {skip, src, dest, overwrite} of [config, settings, database]) { if (skip) { continue; } - await fsExtra.copyFile(src, dest, override ? 0 : FsConstants.COPYFILE_EXCL); + await fsExtra.copyFile(src, dest, overwrite ? 0 : FsConstants.COPYFILE_EXCL); } return null; diff --git a/src/shared/api/main.ts b/src/shared/api/main.ts index 4ab17469d..5f6652cd2 100644 --- a/src/shared/api/main.ts +++ b/src/shared/api/main.ts @@ -131,7 +131,7 @@ export interface InitResponse { src: string; dest: string; skip?: "source doesn't exist" | "destination exists" | "denied read access"; - override?: boolean; + overwrite?: boolean; }>; }; } diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 35deed589..a66a168bc 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -39,12 +39,12 @@ export const PROVIDER_REPO: Record ({{ copyV2App.data.items[itemKey].skip }}) - - (override) -