refactor: convert config path constants to getter functions for dynamic OPENCODE_CONFIG_DIR support

🤖 Generated with assistance of OhMyOpenCode
This commit is contained in:
YeonGyu-Kim
2026-04-05 11:23:01 +09:00
parent b14665f174
commit 98c2f92251
10 changed files with 139 additions and 35 deletions
+3 -2
View File
@@ -1,6 +1,6 @@
import * as fs from "node:fs"
import * as path from "node:path"
import { CACHE_DIR, PACKAGE_NAME, USER_CONFIG_DIR } from "./constants"
import { CACHE_DIR, PACKAGE_NAME, getUserConfigDir } from "./constants"
import { log } from "../../shared/logger"
interface BunLockfile {
@@ -61,8 +61,9 @@ function removeFromBunLock(packageName: string): boolean {
export function invalidatePackage(packageName: string = PACKAGE_NAME): boolean {
try {
const userConfigDir = getUserConfigDir()
const pkgDirs = [
path.join(USER_CONFIG_DIR, "node_modules", packageName),
path.join(userConfigDir, "node_modules", packageName),
path.join(CACHE_DIR, "node_modules", packageName),
]