Skip to content

Commit 6d5f4ba

Browse files
hkaltaiclaude
andcommitted
refactor(uninstall): check installer files concurrently
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 9e5efc0 commit 6d5f4ba

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

‎packages/opencode/src/cli/cmd/uninstall.ts‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,16 @@ async function collectRemovalTargets(args: UninstallArgs, method: Installation.M
199199
const binary = method === "curl" ? process.execPath : null
200200
// altimate_change start — a real directory at one of those names is not the installer's (it
201201
// skips them), so it is left out
202-
const installerFiles: string[] = []
203-
for (const file of binary ? installerSiblingFiles(binary, process.platform) : []) {
204-
const present = await fs.lstat(file).then(
205-
(stat) => !stat.isDirectory(),
206-
() => false,
207-
)
208-
if (present) installerFiles.push(file)
209-
}
202+
const candidates = binary ? installerSiblingFiles(binary, process.platform) : []
203+
const present = await Promise.all(
204+
candidates.map((file) =>
205+
fs.lstat(file).then(
206+
(stat) => !stat.isDirectory(),
207+
() => false,
208+
),
209+
),
210+
)
211+
const installerFiles = candidates.filter((_, index) => present[index])
210212

211213
return { directories, shellConfig, binary, installerFiles }
212214
// altimate_change end

0 commit comments

Comments
 (0)