offgrid-ai 0.2.3 → 0.2.4
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/package.json +1 -1
- package/src/cli.mjs +11 -3
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { homedir } from "node:os";
|
|
2
|
-
import { existsSync, statSync, rmSync, readFileSync, appendFileSync } from "node:fs";
|
|
2
|
+
import { existsSync, statSync, rmSync, readFileSync, appendFileSync, mkdirSync, copyFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { ensureDirs, findLlamaServer, hasHomebrew, DATA_DIR } from "./config.mjs";
|
|
5
5
|
import { scanGgufModels } from "./scan.mjs";
|
|
@@ -587,9 +587,17 @@ async function onboardFlow() {
|
|
|
587
587
|
const { execFile } = await import("node:child_process");
|
|
588
588
|
const { promisify } = await import("node:util");
|
|
589
589
|
|
|
590
|
+
const lmsAppBundle = "/Applications/LM Studio.app/Contents/Resources/app/.webpack/lms";
|
|
591
|
+
const lmsBin = join(homedir(), ".lmstudio", "bin");
|
|
592
|
+
|
|
590
593
|
const ensureLmsOnPath = () => {
|
|
591
|
-
const
|
|
592
|
-
|
|
594
|
+
const lmsDest = join(lmsBin, "lms");
|
|
595
|
+
// Bootstrap lms from app bundle if not yet in ~/.lmstudio/bin
|
|
596
|
+
if (!existsSync(lmsDest) && existsSync(lmsAppBundle)) {
|
|
597
|
+
mkdirSync(lmsBin, { recursive: true });
|
|
598
|
+
copyFileSync(lmsAppBundle, lmsDest);
|
|
599
|
+
}
|
|
600
|
+
if (!existsSync(lmsDest)) return;
|
|
593
601
|
if (process.env.PATH.split(":").includes(lmsBin)) return;
|
|
594
602
|
process.env.PATH = `${lmsBin}:${process.env.PATH}`;
|
|
595
603
|
const profileFiles = [join(homedir(), ".zshrc"), join(homedir(), ".bash_profile")];
|