arisa 2.1.7 → 2.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/bin/arisa.js +15 -4
- package/package.json +1 -1
package/bin/arisa.js
CHANGED
|
@@ -437,8 +437,10 @@ function step(ok, msg) {
|
|
|
437
437
|
process.stdout.write(` ${ok ? "\u2713" : "\u2717"} ${msg}\n`);
|
|
438
438
|
}
|
|
439
439
|
|
|
440
|
+
const ARISA_BUN_ENV = 'export BUN_INSTALL=/home/arisa/.bun && export PATH=/home/arisa/.bun/bin:$PATH';
|
|
441
|
+
|
|
440
442
|
function runAsInherit(cmd) {
|
|
441
|
-
return spawnSync("su", ["-", "arisa", "-c", cmd], {
|
|
443
|
+
return spawnSync("su", ["-", "arisa", "-c", `${ARISA_BUN_ENV} && ${cmd}`], {
|
|
442
444
|
stdio: "inherit",
|
|
443
445
|
timeout: 180_000,
|
|
444
446
|
});
|
|
@@ -472,6 +474,15 @@ function provisionArisaUser() {
|
|
|
472
474
|
}
|
|
473
475
|
step(true, "Bun installed for arisa");
|
|
474
476
|
|
|
477
|
+
// Ensure .profile has bun PATH (login shells skip .bashrc non-interactive guard)
|
|
478
|
+
const profilePath = "/home/arisa/.profile";
|
|
479
|
+
const profileContent = existsSync(profilePath) ? readFileSync(profilePath, "utf8") : "";
|
|
480
|
+
if (!profileContent.includes("BUN_INSTALL")) {
|
|
481
|
+
const bunPath = '\n# bun\nexport BUN_INSTALL="/home/arisa/.bun"\nexport PATH="$BUN_INSTALL/bin:$PATH"\n';
|
|
482
|
+
writeFileSync(profilePath, profileContent + bunPath, "utf8");
|
|
483
|
+
spawnSync("chown", ["arisa:arisa", profilePath], { stdio: "ignore" });
|
|
484
|
+
}
|
|
485
|
+
|
|
475
486
|
// 3. Copy arisa source
|
|
476
487
|
const dest = "/home/arisa/arisa";
|
|
477
488
|
spawnSync("cp", ["-r", pkgRoot, dest], { stdio: "pipe" });
|
|
@@ -575,7 +586,7 @@ if (isRoot()) {
|
|
|
575
586
|
step(true, "Systemd service enabled (auto-starts on reboot)");
|
|
576
587
|
|
|
577
588
|
process.stdout.write("\nStarting interactive setup as user arisa...\n\n");
|
|
578
|
-
const su = spawnSync("su", ["-", "arisa", "-c",
|
|
589
|
+
const su = spawnSync("su", ["-", "arisa", "-c", `${ARISA_BUN_ENV} && /home/arisa/.bun/bin/bun /home/arisa/arisa/src/daemon/index.ts`], {
|
|
579
590
|
stdio: "inherit",
|
|
580
591
|
});
|
|
581
592
|
|
|
@@ -604,7 +615,7 @@ Arisa management:
|
|
|
604
615
|
if (isDefaultInvocation) {
|
|
605
616
|
if (!isArisaConfigured()) {
|
|
606
617
|
process.stdout.write("Arisa is not configured yet. Starting interactive setup...\n\n");
|
|
607
|
-
const su = spawnSync("su", ["-", "arisa", "-c",
|
|
618
|
+
const su = spawnSync("su", ["-", "arisa", "-c", `${ARISA_BUN_ENV} && /home/arisa/.bun/bin/bun /home/arisa/arisa/src/daemon/index.ts`], {
|
|
608
619
|
stdio: "inherit",
|
|
609
620
|
});
|
|
610
621
|
process.stdout.write(`
|
|
@@ -640,7 +651,7 @@ Arisa management:
|
|
|
640
651
|
case "daemon":
|
|
641
652
|
case "run": {
|
|
642
653
|
// Explicit "arisa daemon/run" → foreground as arisa user
|
|
643
|
-
const su = spawnSync("su", ["-", "arisa", "-c",
|
|
654
|
+
const su = spawnSync("su", ["-", "arisa", "-c", `${ARISA_BUN_ENV} && /home/arisa/.bun/bin/bun /home/arisa/arisa/src/daemon/index.ts`], {
|
|
644
655
|
stdio: "inherit",
|
|
645
656
|
});
|
|
646
657
|
process.exit(su.status ?? 1);
|