@d5render/cli 0.1.80 → 0.1.82

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.
Files changed (2) hide show
  1. package/bin/d5cli +18 -4
  2. package/package.json +1 -1
package/bin/d5cli CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { argv, env, platform } from "node:process";
3
- import { execSync, spawn } from "node:child_process";
3
+ import { execSync, spawn, spawnSync } from "node:child_process";
4
4
  import { createHash } from "node:crypto";
5
5
  import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
6
6
  import { dirname, join } from "node:path";
@@ -8,7 +8,7 @@ import { fileURLToPath } from "node:url";
8
8
 
9
9
  //#region package.json
10
10
  var name$1 = "@d5render/cli";
11
- var version = "0.1.80";
11
+ var version = "0.1.82";
12
12
 
13
13
  //#endregion
14
14
  //#region packages/env.ts
@@ -318,8 +318,22 @@ async function cli() {
318
318
  if (httpProxy) env.HTTP_PROXY = httpProxy;
319
319
  if (httpsProxy) env.HTTPS_PROXY = httpsProxy;
320
320
  console.log("@d5render/cli version:", VERSION);
321
+ const childEnv = platform === "win32" ? void 0 : env;
322
+ if (childEnv) {
323
+ console.log("child env keys count:", Object.keys(childEnv).length);
324
+ console.log("child env token keys present:", [
325
+ "COPILOT_GITHUB_TOKEN",
326
+ "GH_TOKEN",
327
+ "GITHUB_TOKEN"
328
+ ].filter((k) => childEnv[k]).join(", ") || "(none)");
329
+ const check = spawnSync(process.execPath, ["-e", "console.log(process.env.COPILOT_GITHUB_TOKEN ? 'env injected: OK' : 'env injected: MISSING')"], {
330
+ env: childEnv,
331
+ encoding: "utf8"
332
+ });
333
+ console.log(check.stdout?.trim() || check.stderr?.trim() || "env check: (no output)");
334
+ } else console.log("child env: inherits process.env (win32)");
321
335
  const child = spawn(bind, [
322
- ...getTools(),
336
+ ...tools,
323
337
  "-p",
324
338
  `"${common_review_prompt.replace(/"/g, "\\\"")}"`
325
339
  ], {
@@ -329,7 +343,7 @@ async function cli() {
329
343
  "pipe",
330
344
  "pipe"
331
345
  ],
332
- ...platform === "win32" ? { shell: true } : { env: { ...env } }
346
+ ...platform === "win32" ? { shell: true } : { env: childEnv }
333
347
  });
334
348
  child.stdout.on("data", (chunk) => console.log(String(chunk)));
335
349
  child.stderr.on("data", (chunk) => console.error(String(chunk)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d5render/cli",
3
- "version": "0.1.80",
3
+ "version": "0.1.82",
4
4
  "license": "MIT",
5
5
  "author": "jasirou",
6
6
  "bin": {