Skip to content

Commit fb41b21

Browse files
fix: add default
1 parent 530102e commit fb41b21

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

src/lib/app.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import path from 'path';
33
import { app, dialog } from 'electron';
44
import Store from 'electron-store';
55

6-
const store = new Store();
6+
const store = new Store({
7+
defaults: {
8+
toolsPath: getDefaultInstallPath()
9+
}
10+
});
711

812
const APP_NAME = 'ogs-meshery';
913
export const EXTRA_RESOURCE_PATH = path.join(resourceRoot(), 'extra-resources');
@@ -43,11 +47,10 @@ export async function changeToolsPath() {
4347
}
4448

4549
export function getToolsPath() {
46-
const legacyPath = path.join(resourceRoot(), 'python', 'tools');
47-
if (fs.existsSync(legacyPath)) {
48-
return legacyPath;
49-
}
50-
50+
// const legacyPath = path.join(resourceRoot(), 'python', 'tools');
51+
// if (fs.existsSync(legacyPath)) {
52+
// return legacyPath;
53+
// }
5154
const existing = store.get('toolsPath');
5255
if (existing) {
5356
return existing;
@@ -62,6 +65,7 @@ export function getToolsPath() {
6265
export function setInstallPath(newPath) {
6366
store.set('toolsPath', newPath);
6467
}
68+
6569
export function getRecentProjects() {
6670
const projects = store.get('recentProjects', []);
6771
const filtered = sortByOpened(filterRemoved(projects));

0 commit comments

Comments
 (0)