mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix hotbar migration of workspaces (#3178)
This commit is contained in:
1 parent
b9dfd20a93
commit
51655884c7
39 files changed
+333
-446
No files matched your search
@@ -23,18 +23,18 @@ import fse from "fs-extra";
|
||||
import { app, remote } from "electron";
|
||||
import path from "path";
|
||||
|
||||
export async function fileNameMigration() {
|
||||
export function fileNameMigration() {
|
||||
const userDataPath = (app || remote.app).getPath("userData");
|
||||
const configJsonPath = path.join(userDataPath, "config.json");
|
||||
const lensUserStoreJsonPath = path.join(userDataPath, "lens-user-store.json");
|
||||
|
||||
try {
|
||||
await fse.move(configJsonPath, lensUserStoreJsonPath);
|
||||
fse.moveSync(configJsonPath, lensUserStoreJsonPath);
|
||||
} catch (error) {
|
||||
if (error.code === "ENOENT" && error.path === configJsonPath) { // (No such file or directory)
|
||||
return; // file already moved
|
||||
} else if (error.message === "dest already exists.") {
|
||||
await fse.remove(configJsonPath);
|
||||
fse.removeSync(configJsonPath);
|
||||
} else {
|
||||
// pass other errors along
|
||||
throw error;
|
||||
|
||||
Reference in new issue
Block a user