fix(installer): always use .config/opencode for CLI on Windows (#2502)
This commit is contained in:
@@ -49,22 +49,7 @@ function getCliConfigDir(): string {
|
||||
}
|
||||
|
||||
if (process.platform === "win32") {
|
||||
const crossPlatformDir = join(homedir(), ".config", "opencode")
|
||||
const crossPlatformConfig = join(crossPlatformDir, "opencode.json")
|
||||
|
||||
if (existsSync(crossPlatformConfig)) {
|
||||
return crossPlatformDir
|
||||
}
|
||||
|
||||
const appData = process.env.APPDATA || join(homedir(), "AppData", "Roaming")
|
||||
const appdataDir = join(appData, "opencode")
|
||||
const appdataConfig = join(appdataDir, "opencode.json")
|
||||
|
||||
if (existsSync(appdataConfig)) {
|
||||
return appdataDir
|
||||
}
|
||||
|
||||
return crossPlatformDir
|
||||
return join(homedir(), ".config", "opencode")
|
||||
}
|
||||
|
||||
const xdgConfig = process.env.XDG_CONFIG_HOME || join(homedir(), ".config")
|
||||
|
||||
Reference in New Issue
Block a user