Skip to content

Commit e350308

Browse files
authored
fix(amazonq): verify path for .obsolete file (#5671)
verify path for .obsolete file License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent aa3f1a7 commit e350308

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/shared/handleUninstall.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Implementation inspired by https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/c864f15af264f0f456a6d8a83290b5c940715349/client/vscode/src/settings/uninstall.ts#L2
77

88
import * as vscode from 'vscode'
9+
import { existsSync } from 'fs'
910
import { join } from 'path'
1011
import { getLogger } from './logger/logger'
1112
import { telemetry } from './telemetry'
@@ -80,7 +81,7 @@ export function setupUninstallHandler(
8081

8182
const obsoleteFilePath = join(extensionsDirPath, '.obsolete')
8283

83-
if (extensionsDirPath && obsoleteFilePath) {
84+
if (extensionsDirPath && obsoleteFilePath && existsSync(obsoleteFilePath)) {
8485
const watchPattern = new vscode.RelativePattern(extensionsDirPath, '.obsolete')
8586
const fileWatcher = vscode.workspace.createFileSystemWatcher(watchPattern)
8687

0 commit comments

Comments
 (0)