Skip to content

Commit

Permalink
The Linux paths should be set only when running on Linux.
Browse files Browse the repository at this point in the history
This fixes an exception when run on Windows.

Signed-off-by: Eric Promislow <[email protected]>
(cherry picked from commit 217c27f)
  • Loading branch information
ericpromislow authored and jandubois committed Mar 20, 2023
1 parent d51363b commit 227f3a9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/rancher-desktop/main/deploymentProfiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ export function readDeploymentProfiles(): settings.DeploymentProfileType {
defaults: {},
locked: {},
};
const linuxPaths = {
[paths.deploymentProfileSystem]: ['defaults.json', 'locked.json'],
[paths.deploymentProfileUser]: ['rancher-desktop.defaults.json', 'rancher-desktop.locked.json'],
};

switch (os.platform()) {
case 'win32':
Expand Down Expand Up @@ -84,7 +80,12 @@ export function readDeploymentProfiles(): settings.DeploymentProfileType {
}
}
break;
case 'linux':
case 'linux': {
const linuxPaths = {
[paths.deploymentProfileSystem]: ['defaults.json', 'locked.json'],
[paths.deploymentProfileUser]: ['rancher-desktop.defaults.json', 'rancher-desktop.locked.json'],
};

for (const configDir in linuxPaths) {
const [defaults, locked] = linuxPaths[configDir];

Expand All @@ -93,6 +94,7 @@ export function readDeploymentProfiles(): settings.DeploymentProfileType {
break;
}
}
}
break;
case 'darwin':
for (const rootPath of [paths.deploymentProfileSystem, paths.deploymentProfileUser]) {
Expand Down

0 comments on commit 227f3a9

Please sign in to comment.