@lousy-agents/cli 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -32764,18 +32764,16 @@ function defaultExec(command, args, options) {
32764
32764
  }
32765
32765
  /**
32766
32766
  * Resolves a GitHub token from GH_TOKEN/GITHUB_TOKEN env vars, with gh CLI fallback
32767
- */ async function resolveGitHubToken() {
32768
- const envToken = process.env.GH_TOKEN || process.env.GITHUB_TOKEN;
32767
+ */ async function resolveGitHubToken(exec = defaultExec) {
32768
+ const envToken = process.env.GH_TOKEN?.trim() || process.env.GITHUB_TOKEN?.trim();
32769
32769
  if (envToken) {
32770
32770
  return envToken;
32771
32771
  }
32772
32772
  try {
32773
- const { stdout } = await execFileAsync("gh", [
32773
+ const { stdout } = await exec("gh", [
32774
32774
  "auth",
32775
32775
  "token"
32776
- ], {
32777
- encoding: "utf-8"
32778
- });
32776
+ ]);
32779
32777
  const token = stdout.trim();
32780
32778
  return token || null;
32781
32779
  } catch {