skillfoxx 0.1.0 → 0.1.1
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/cli.js +25 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7371,7 +7371,7 @@ var require_dist = __commonJS({
|
|
|
7371
7371
|
import { parseArgs } from "node:util";
|
|
7372
7372
|
|
|
7373
7373
|
// src/context.ts
|
|
7374
|
-
import { execFile } from "node:child_process";
|
|
7374
|
+
import { execFile, execFileSync } from "node:child_process";
|
|
7375
7375
|
import { constants } from "node:fs";
|
|
7376
7376
|
import { access } from "node:fs/promises";
|
|
7377
7377
|
import os from "node:os";
|
|
@@ -19980,7 +19980,28 @@ var CliError = class extends Error {
|
|
|
19980
19980
|
}
|
|
19981
19981
|
};
|
|
19982
19982
|
var tr = (ctx, ru, en) => ctx.lang === "ru" ? ru : en;
|
|
19983
|
-
var detectLang = (env
|
|
19983
|
+
var detectLang = (env, systemLocale2 = () => null) => {
|
|
19984
|
+
const fromEnv = [env.LC_ALL, env.LC_MESSAGES, env.LANG].find((v) => v && !/^(C|POSIX)(\.|$)/i.test(v));
|
|
19985
|
+
const locale = fromEnv ?? systemLocale2();
|
|
19986
|
+
if (!locale) return "ru";
|
|
19987
|
+
return /^ru/i.test(locale) ? "ru" : "en";
|
|
19988
|
+
};
|
|
19989
|
+
var systemLocale = (platform) => {
|
|
19990
|
+
if (platform === "darwin") {
|
|
19991
|
+
try {
|
|
19992
|
+
const out = execFileSync("defaults", ["read", "-g", "AppleLanguages"], { encoding: "utf8", timeout: 500, stdio: ["ignore", "pipe", "ignore"] });
|
|
19993
|
+
const first = out.match(/"?([A-Za-z]{2}(?:[-_][A-Za-z0-9]+)*)"?/);
|
|
19994
|
+
if (first) return first[1];
|
|
19995
|
+
} catch {
|
|
19996
|
+
}
|
|
19997
|
+
}
|
|
19998
|
+
try {
|
|
19999
|
+
const loc = Intl.DateTimeFormat().resolvedOptions().locale;
|
|
20000
|
+
return loc && !/^en(-US)?$/i.test(loc) ? loc : null;
|
|
20001
|
+
} catch {
|
|
20002
|
+
return null;
|
|
20003
|
+
}
|
|
20004
|
+
};
|
|
19984
20005
|
var maskedWrite = (question, output2) => (s) => {
|
|
19985
20006
|
if (s.includes(question)) output2.write(question);
|
|
19986
20007
|
};
|
|
@@ -20025,7 +20046,7 @@ var makeCtx = (over = {}) => {
|
|
|
20025
20046
|
platform: process.platform,
|
|
20026
20047
|
fetch: globalThis.fetch.bind(globalThis),
|
|
20027
20048
|
tty: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
20028
|
-
lang: detectLang(env),
|
|
20049
|
+
lang: detectLang(env, () => systemLocale(process.platform)),
|
|
20029
20050
|
api: DEFAULT_API,
|
|
20030
20051
|
keys: TRUSTED_RECIPE_KEYS,
|
|
20031
20052
|
out: (line) => void process.stdout.write(`${line}
|
|
@@ -20057,7 +20078,7 @@ var findOnPath = async (ctx, bin) => {
|
|
|
20057
20078
|
};
|
|
20058
20079
|
|
|
20059
20080
|
// src/version.ts
|
|
20060
|
-
var VERSION = true ? "0.1.
|
|
20081
|
+
var VERSION = true ? "0.1.1" : "0.0.0-dev";
|
|
20061
20082
|
|
|
20062
20083
|
// src/api.ts
|
|
20063
20084
|
var DAY = 24 * 36e5;
|
package/package.json
CHANGED