@lawaty/lacode 0.1.7 → 0.1.8
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 +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2163,6 +2163,7 @@ var INSTALL_TIMEOUT_MS = 12e4;
|
|
|
2163
2163
|
var LOCK_STALE_MS = 10 * 60 * 1e3;
|
|
2164
2164
|
var CHILD_ENV = "LACODE_SELFUPDATE_CHILD";
|
|
2165
2165
|
var OPT_OUT_ENV = "LACODE_NO_SELFUPDATE";
|
|
2166
|
+
var inTestRunner = (env = process.env) => typeof env.NODE_TEST_CONTEXT === "string" && env.NODE_TEST_CONTEXT.length > 0;
|
|
2166
2167
|
var STATE_DIR = join6(homedir2(), ".local", "share", "opencode", "lacode");
|
|
2167
2168
|
var STATE_PATH = join6(STATE_DIR, "selfupdate.json");
|
|
2168
2169
|
var LOCK_PATH = join6(STATE_DIR, "selfupdate.lock");
|
|
@@ -2329,7 +2330,7 @@ async function refreshCache(opts) {
|
|
|
2329
2330
|
}
|
|
2330
2331
|
async function maybeSelfUpdate(opts) {
|
|
2331
2332
|
const env = opts.env ?? process.env;
|
|
2332
|
-
if (opts.enabled === false || env[CHILD_ENV] === "1" || env[OPT_OUT_ENV] === "1") {
|
|
2333
|
+
if (opts.enabled === false || env[CHILD_ENV] === "1" || env[OPT_OUT_ENV] === "1" || inTestRunner(env)) {
|
|
2333
2334
|
return { action: "disabled" };
|
|
2334
2335
|
}
|
|
2335
2336
|
const now = (opts.now ?? Date.now)();
|
package/package.json
CHANGED