@tostudy-ai/cli 0.18.11 → 0.18.13
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/main.js +26 -21
- package/dist/main.js.map +3 -3
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1842,12 +1842,30 @@ var init_formatter = __esm({
|
|
|
1842
1842
|
}
|
|
1843
1843
|
});
|
|
1844
1844
|
|
|
1845
|
+
// src/io/has-binary.ts
|
|
1846
|
+
import { execFileSync } from "node:child_process";
|
|
1847
|
+
function locatorCommand() {
|
|
1848
|
+
return process.platform === "win32" ? "where" : "which";
|
|
1849
|
+
}
|
|
1850
|
+
function hasBinary(name) {
|
|
1851
|
+
try {
|
|
1852
|
+
execFileSync(locatorCommand(), [name], { encoding: "utf-8", stdio: "pipe", timeout: 3e3 });
|
|
1853
|
+
return true;
|
|
1854
|
+
} catch {
|
|
1855
|
+
return false;
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
var init_has_binary = __esm({
|
|
1859
|
+
"src/io/has-binary.ts"() {
|
|
1860
|
+
"use strict";
|
|
1861
|
+
}
|
|
1862
|
+
});
|
|
1863
|
+
|
|
1845
1864
|
// src/installer/ide-detector.ts
|
|
1846
1865
|
var ide_detector_exports = {};
|
|
1847
1866
|
__export(ide_detector_exports, {
|
|
1848
1867
|
detectIDEs: () => detectIDEs
|
|
1849
1868
|
});
|
|
1850
|
-
import { execFileSync } from "node:child_process";
|
|
1851
1869
|
import fs3 from "node:fs";
|
|
1852
1870
|
import path4 from "node:path";
|
|
1853
1871
|
import os3 from "node:os";
|
|
@@ -1937,11 +1955,7 @@ function detectIDEs(home = os3.homedir()) {
|
|
|
1937
1955
|
];
|
|
1938
1956
|
const claudeIde = ides.find((ide) => ide.id === "claude-code");
|
|
1939
1957
|
if (claudeIde) {
|
|
1940
|
-
|
|
1941
|
-
execFileSync("which", ["claude"], { encoding: "utf-8" });
|
|
1942
|
-
claudeIde.detected = true;
|
|
1943
|
-
} catch {
|
|
1944
|
-
}
|
|
1958
|
+
claudeIde.detected = hasBinary("claude");
|
|
1945
1959
|
}
|
|
1946
1960
|
for (const [id, bin] of [
|
|
1947
1961
|
["grok", "grok"],
|
|
@@ -1949,11 +1963,7 @@ function detectIDEs(home = os3.homedir()) {
|
|
|
1949
1963
|
]) {
|
|
1950
1964
|
const ide = ides.find((i) => i.id === id);
|
|
1951
1965
|
if (ide && !ide.detected) {
|
|
1952
|
-
|
|
1953
|
-
execFileSync("which", [bin], { encoding: "utf-8" });
|
|
1954
|
-
ide.detected = true;
|
|
1955
|
-
} catch {
|
|
1956
|
-
}
|
|
1966
|
+
ide.detected = hasBinary(bin);
|
|
1957
1967
|
}
|
|
1958
1968
|
}
|
|
1959
1969
|
return ides;
|
|
@@ -1961,6 +1971,7 @@ function detectIDEs(home = os3.homedir()) {
|
|
|
1961
1971
|
var init_ide_detector = __esm({
|
|
1962
1972
|
"src/installer/ide-detector.ts"() {
|
|
1963
1973
|
"use strict";
|
|
1974
|
+
init_has_binary();
|
|
1964
1975
|
}
|
|
1965
1976
|
});
|
|
1966
1977
|
|
|
@@ -2333,14 +2344,6 @@ __export(runtime_registry_exports, {
|
|
|
2333
2344
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
2334
2345
|
import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
2335
2346
|
import { dirname, join as join2 } from "node:path";
|
|
2336
|
-
function hasBinary(name) {
|
|
2337
|
-
try {
|
|
2338
|
-
execFileSync2("which", [name], { encoding: "utf-8", stdio: "pipe" });
|
|
2339
|
-
return true;
|
|
2340
|
-
} catch {
|
|
2341
|
-
return false;
|
|
2342
|
-
}
|
|
2343
|
-
}
|
|
2344
2347
|
function writeFile2(absDir, fileName, body) {
|
|
2345
2348
|
mkdirSync2(absDir, { recursive: true });
|
|
2346
2349
|
writeFileSync2(join2(absDir, fileName), body);
|
|
@@ -2467,6 +2470,7 @@ var init_runtime_registry = __esm({
|
|
|
2467
2470
|
"use strict";
|
|
2468
2471
|
init_dist();
|
|
2469
2472
|
init_slug();
|
|
2473
|
+
init_has_binary();
|
|
2470
2474
|
init_instruction_template_v3();
|
|
2471
2475
|
logger2 = createLogger("cli:runtime-registry");
|
|
2472
2476
|
detectOpencode = (home) => existsSync2(join2(home, ".opencode")) || existsSync2(join2(home, ".config", "opencode"));
|
|
@@ -3846,7 +3850,7 @@ init_workspace_state();
|
|
|
3846
3850
|
init_formatter();
|
|
3847
3851
|
|
|
3848
3852
|
// src/version.ts
|
|
3849
|
-
var CLI_VERSION = true ? "0.18.
|
|
3853
|
+
var CLI_VERSION = true ? "0.18.13" : "0.7.1";
|
|
3850
3854
|
|
|
3851
3855
|
// src/update-checker.ts
|
|
3852
3856
|
init_config_dir();
|
|
@@ -20190,8 +20194,9 @@ var menuCommand = new Command18("menu").description("Show available commands and
|
|
|
20190
20194
|
} else {
|
|
20191
20195
|
lines.push(
|
|
20192
20196
|
" Curso ativo: (nenhum)",
|
|
20193
|
-
" \u2192 tostudy courses
|
|
20197
|
+
" \u2192 tostudy courses para ver seus cursos",
|
|
20194
20198
|
" \u2192 tostudy select <n\xFAmero> para ativar um curso",
|
|
20199
|
+
" \u2192 tostudy suggest se voc\xEA ainda n\xE3o tem nenhum curso",
|
|
20195
20200
|
""
|
|
20196
20201
|
);
|
|
20197
20202
|
}
|