Restoring the integrations location on Windows

Windows does not need this location but there are code paths that
do not handle an error being returned. There are multiple code paths
like this. Restoring the mac location, which has long been used.

In a future change, this can be removed and the other code paths fixed
to handle an error being returned.

Signed-off-by: Matt Farina <matt.farina@suse.com>
This commit is contained in:
Matt Farina
2021-10-11 16:42:33 -04:00
parent d6d3c68fb7
commit f30ff31930
2 changed files with 12 additions and 2 deletions

View File

@@ -38,7 +38,12 @@ describe('paths', () => {
darwin: '%HOME%/Library/State/rancher-desktop/driver/', darwin: '%HOME%/Library/State/rancher-desktop/driver/',
}, },
integration: { integration: {
win32: Error(), // The integration code paths do not currently support error handling
// and returning an error causes exceptions on Windows. This needs to
// be reworked to handle no location on Windows. See that paths.ts
// file for more detail.
// win32: Error(),
win32: '/usr/local/bin',
darwin: '/usr/local/bin', darwin: '/usr/local/bin',
}, },
}; };

View File

@@ -80,7 +80,12 @@ export class Win32Paths implements Paths {
} }
get integration(): string { get integration(): string {
throw new Error('integration path not available for Windows'); return '/usr/local/bin';
// The current code paths on Windows fail if no location is returned to watch.
// Before we can throw an exception, the code paths that use the returned string
// need to be refactored to handle an error. The current location being returned
// is the location that has been in use.
// throw new Error('integration path not available for Windows');
} }
} }