File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import fs from "fs";
22import path from "path" ;
33import { spawn } from "child_process" ;
44import { createRequire } from "module" ;
5+ import { hasCommand } from "@portosaur/core" ;
56
67/**
78 * Generates a static Docusaurus config file by evaluating the Portosaur config
@@ -174,7 +175,11 @@ export async function runDocusaurus(
174175 args . push ( ...extraArgs ) ;
175176
176177 // Use bun when available for faster builds, fall back to node.
177- const runtime = typeof Bun !== "undefined" ? "bun" : "node" ;
178+ // If node isn't installed, fallback to bun gracefully.
179+ let runtime = "node" ;
180+ if ( typeof Bun !== "undefined" || ! hasCommand ( "node" ) ) {
181+ runtime = "bun" ;
182+ }
178183
179184 // Skip actual execution in test mode
180185 if ( process . env . PORTO_TEST_MODE === "true" ) {
@@ -186,10 +191,6 @@ export async function runDocusaurus(
186191
187192 const childEnv = { ...process . env , FORCE_COLOR : "true" } ;
188193
189- if ( command === "build" ) {
190- childEnv . CI = "true" ;
191- }
192-
193194 const child = spawn ( runtime , args , {
194195 stdio : "inherit" ,
195196 cwd : UserRoot ,
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ bun run "$REPO_ROOT/packages/cli/bin/porto.mjs" init \
2323# --- Link local packages into the new project ---
2424echo " 📦 Installing local packages..."
2525cd " $SITE_DIR "
26+
27+ # Prevent manual developer runs (e.g. bun run dev) from overwriting local links
28+ # by stripping the auto-install step from package scripts
29+ sed -i ' s/$npm_execpath install && //' package.json
30+
2631bun install
2732bun link @portosaur/cli @portosaur/theme @portosaur/core @portosaur/logger @portosaur/wizard
2833
You can’t perform that action at this time.
0 commit comments