mirror of
https://github.com/podman-desktop/podman-desktop
synced 2026-04-21 09:37:22 +00:00
fix(compose): sync provider version on CLI tool install/uninstall
Signed-off-by: Simon Rey <srey@redhat.com> Co-authored-by: Simon Rey (via Cursor AI) <srey@redhat.com> Made-with: Cursor Signed-off-by: Simon Rey <51708585+simonrey1@users.noreply.github.com>
This commit is contained in:
parent
040aa7f179
commit
854739d581
2 changed files with 8 additions and 0 deletions
|
|
@ -357,6 +357,9 @@ describe('registerCLITool', () => {
|
|||
installationSource: 'extension',
|
||||
version: '1.0.0',
|
||||
});
|
||||
|
||||
const providerMock = vi.mocked(extensionApi.provider.createProvider).mock.results[0].value as Provider;
|
||||
expect(providerMock.updateVersion).toHaveBeenCalledWith('1.0.0');
|
||||
});
|
||||
|
||||
test('by uninstalling it should delete all executables', async () => {
|
||||
|
|
@ -390,6 +393,9 @@ describe('registerCLITool', () => {
|
|||
await installer?.doUninstall({} as unknown as Logger);
|
||||
expect(fs.promises.unlink).toHaveBeenNthCalledWith(1, 'storage-path');
|
||||
expect(extensionApi.process.exec).toHaveBeenCalledWith('rm', ['system-wide-path'], { isAdmin: true });
|
||||
|
||||
const providerMock = vi.mocked(extensionApi.provider.createProvider).mock.results[0].value as Provider;
|
||||
expect(providerMock.updateVersion).toHaveBeenCalledWith('');
|
||||
});
|
||||
|
||||
test('if unlink fails because of a permission issue, it should delete all binaries as admin', async () => {
|
||||
|
|
|
|||
|
|
@ -416,6 +416,7 @@ async function registerCLITool(
|
|||
installationSource: 'extension',
|
||||
});
|
||||
binaryVersion = releaseVersionToInstall;
|
||||
provider.updateVersion(releaseVersionToInstall);
|
||||
releaseVersionToInstall = undefined;
|
||||
releaseToInstall = undefined;
|
||||
extensionApi.context.setValue('compose.isComposeInstalledSystemWide', true);
|
||||
|
|
@ -436,6 +437,7 @@ async function registerCLITool(
|
|||
// update the version to undefined
|
||||
binaryVersion = undefined;
|
||||
binaryPath = undefined;
|
||||
provider.updateVersion('');
|
||||
extensionApi.context.setValue('compose.isComposeInstalledSystemWide', false);
|
||||
composeProviderUpdateDisposable?.dispose();
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue