fix(coding-agent): support PI_CODING_AGENT_DIR env var in example extensions (#2009)
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
import { type Api, type Context, type Model, registerApiProvider, streamSimple } from "@mariozechner/pi-ai";
|
||||
import { readFileSync } from "fs";
|
||||
import { homedir } from "os";
|
||||
import { getAgentDir } from "packages/coding-agent/src/config.js";
|
||||
import { join } from "path";
|
||||
import { MODELS, streamGitLabDuo } from "./index.js";
|
||||
|
||||
@@ -28,7 +28,7 @@ async function main() {
|
||||
}
|
||||
|
||||
// Read auth
|
||||
const authPath = join(homedir(), ".pi", "agent", "auth.json");
|
||||
const authPath = join(getAgentDir(), "extensions", "auth.json");
|
||||
const authData = JSON.parse(readFileSync(authPath, "utf-8"));
|
||||
const gitlabCred = authData["gitlab-duo"];
|
||||
if (!gitlabCred?.access) {
|
||||
|
||||
Reference in New Issue
Block a user