@opencrater/sdk 0.8.50 → 0.8.51
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.
Potentially problematic release.
This version of @opencrater/sdk might be problematic. Click here for more details.
- package/dist/paint.js +10 -2
- package/package.json +1 -1
package/dist/paint.js
CHANGED
|
@@ -451,7 +451,7 @@ function escapeToPersistentPainter(payload, consolePid) {
|
|
|
451
451
|
const dir = path3__namespace.join(os.homedir(), ".config", "opencrater");
|
|
452
452
|
fs2.mkdirSync(dir, { recursive: true });
|
|
453
453
|
const file = path3__namespace.join(dir, `paint-${process.pid}-${Date.now()}.json`);
|
|
454
|
-
fs2.writeFileSync(file, JSON.stringify(payload), "utf8");
|
|
454
|
+
fs2.writeFileSync(file, JSON.stringify({ ...payload, _env: process.env }), "utf8");
|
|
455
455
|
const q = (s) => `"${s}"`;
|
|
456
456
|
const parts = [
|
|
457
457
|
q(process.execPath),
|
|
@@ -857,7 +857,15 @@ function main() {
|
|
|
857
857
|
}
|
|
858
858
|
let payload;
|
|
859
859
|
try {
|
|
860
|
-
|
|
860
|
+
const parsed = JSON.parse(raw);
|
|
861
|
+
if (parsed._env && typeof parsed._env === "object") {
|
|
862
|
+
const keepPid = process.env["OPENCRATER_WIN_CONSOLE_PID"];
|
|
863
|
+
Object.assign(process.env, parsed._env);
|
|
864
|
+
if (keepPid) process.env["OPENCRATER_WIN_CONSOLE_PID"] = keepPid;
|
|
865
|
+
if (process.env["OPENCRATER_DEBUG"] === "1") DEBUG_ON = true;
|
|
866
|
+
delete parsed._env;
|
|
867
|
+
}
|
|
868
|
+
payload = parsed;
|
|
861
869
|
} catch (err) {
|
|
862
870
|
pdebug("paint payload is not valid JSON:", err.message);
|
|
863
871
|
return;
|