This commit is contained in:
luk
2026-08-21 10:24:09 +08:00
parent df1464b887
commit f7eb1808a8
4 changed files with 91 additions and 13 deletions

View File

@@ -106,7 +106,13 @@ async function main () {
let model = existingModel
if (filePath) {
const secret = readJsonIfExists(filePath)
const expandedFilePath = filePath.replace(
/^~(?=$|[\\/])/,
os.homedir()
)
// Resolve relative paths from the directory where the command is run.
const absoluteFilePath = path.resolve(process.cwd(), expandedFilePath)
const secret = readJsonIfExists(absoluteFilePath)
if (!secret || typeof secret !== 'object' || Array.isArray(secret)) {
rl.close()
console.error(