MCPcopy Create free account
hub / github.com/Noumena-Network/code / removeClaudeAliasesFromShellConfigs

Function removeClaudeAliasesFromShellConfigs

src/utils/autoUpdater.ts:577–599  ·  view source on GitHub ↗

* Remove claude aliases from shell configuration files * This helps clean up old installation methods when switching to native or npm global

()

Source from the content-addressed store, hash-verified

575 * This helps clean up old installation methods when switching to native or npm global
576 */
577async function removeClaudeAliasesFromShellConfigs(): Promise<void> {
578 const configMap = getShellConfigPaths()
579
580 // Process each shell config file
581 for (const [, configFile] of Object.entries(configMap)) {
582 try {
583 const lines = await readFileLines(configFile)
584 if (!lines) continue
585
586 const { filtered, hadAlias } = filterNcodeAliases(lines)
587
588 if (hadAlias) {
589 await writeFileLines(configFile, filtered)
590 logForDebugging(`Removed claude alias from ${configFile}`)
591 }
592 } catch (error) {
593 // Don't fail the whole operation if one file can't be processed
594 logForDebugging(`Failed to remove alias from ${configFile}: ${error}`, {
595 level: 'error',
596 })
597 }
598 }
599}

Callers 1

installGlobalPackageFunction · 0.85

Calls 6

getShellConfigPathsFunction · 0.85
readFileLinesFunction · 0.85
filterNcodeAliasesFunction · 0.85
writeFileLinesFunction · 0.85
entriesMethod · 0.80
logForDebuggingFunction · 0.70

Tested by

no test coverage detected