MCPcopy Create free account
hub / github.com/Railly/agentfiles / buildPath

Function buildPath

src/skillkit.ts:30–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28const BIN_NAMES = IS_WIN ? ["skillkit.cmd", "skillkit.exe", "skillkit"] : ["skillkit"];
29
30function buildPath(): string {
31 const extra: string[] = [];
32 if (IS_WIN) {
33 const appData = process.env.APPDATA || join(HOME, "AppData", "Roaming");
34 extra.push(
35 join(appData, "npm"),
36 join(HOME, ".bun", "bin"),
37 join(HOME, "AppData", "Local", "npm"),
38 );
39 } else {
40 extra.push(
41 "/usr/local/bin",
42 "/opt/homebrew/bin",
43 join(HOME, ".local", "bin"),
44 join(HOME, ".bun", "bin"),
45 join(HOME, ".local", "share", "pnpm"), // pnpm global bin
46 join(HOME, ".volta", "bin"), // Volta
47 join(HOME, ".yarn", "bin"), // Yarn classic
48 join(HOME, ".config", "yarn", "global", "node_modules", ".bin"), // Yarn modern
49 join(HOME, ".fnm", "aliases", "default", "bin"), // fnm
50 join(HOME, ".asdf", "shims"), // asdf
51 join(HOME, ".proto", "bin"), // proto
52 );
53 }
54 const nvmDir = IS_WIN
55 ? join(HOME, "AppData", "Roaming", "nvm")
56 : join(HOME, ".nvm", "versions", "node");
57 try {
58 for (const d of readdirSync(nvmDir)) {
59 extra.push(IS_WIN ? join(nvmDir, d) : join(nvmDir, d, "bin"));
60 }
61 } catch { /* empty */ }
62 if (!IS_WIN) {
63 const miseDir = join(HOME, ".local", "share", "mise", "installs");
64 for (const runtime of ["node", "bun"]) {
65 try {
66 for (const d of readdirSync(join(miseDir, runtime))) {
67 extra.push(join(miseDir, runtime, d, "bin"));
68 }
69 } catch { /* empty */ }
70 }
71 }
72 return [...extra, process.env.PATH || ""].join(delimiter);
73}
74
75function isCrafterSkillkit(binPath: string): boolean {
76 try {

Callers 4

isCrafterSkillkitFunction · 0.70
runSkillkitJsonFunction · 0.70
runSkillkitJsonAsyncFunction · 0.70
runSkillkitActionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected