Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
fix(crbn): `new` also checks out the tree and doesn't rely on pnpm install
Sidwebworksff870f26f8f8
diff --git a/packages/dev/bin/crbn b/packages/dev/bin/crbnindex 92286ad43b..a8c9dc0f1e 100755--- a/packages/dev/bin/crbn+++ b/packages/dev/bin/crbn@@ -74,8 +74,9 @@ delegate_ts() {wt_root="$(git rev-parse --show-toplevel 2>/dev/null)"main_root="$(repo_root)"- # Pick source: worktree first, main fallback.- if [[ -n "$wt_root" && -f "$wt_root/packages/dev/src/main.ts" ]]; then+ # Pick source: worktree first, but only if deps are installed (otherwise+ # imports like `citty` fail). Falls back to main checkout.+ if [[ -n "$wt_root" && -f "$wt_root/packages/dev/src/main.ts" && -d "$wt_root/node_modules" ]]; thensrc="$wt_root/packages/dev/src/main.ts"elsesrc="$main_root/packages/dev/src/main.ts"diff --git a/packages/dev/src/commands/new.ts b/packages/dev/src/commands/new.tsindex 52a24b6d7a..2973da55f7 100644--- a/packages/dev/src/commands/new.ts+++ b/packages/dev/src/commands/new.ts@@ -1,4 +1,4 @@-import { copyFileSync, existsSync } from "node:fs";+import { copyFileSync, existsSync, writeFileSync } from "node:fs";import { intro, outro, tasks } from "@clack/prompts";import { basename, dirname, join, relative, resolve } from "pathe";import pc from "picocolors";@@ -53,7 +53,11 @@ export async function newWorktree() {: [])]);- outro(- `worktree ready — ${pc.cyan(`crbn checkout ${branch} --up`)} to boot it`- );+ // Write target path so the shell wrapper can cd into the new worktree.+ const targetFile = process.env.CRBN_NEW_TARGET;+ if (targetFile) {+ writeFileSync(targetFile, targetPath);+ }++ outro(`worktree ready — ${pc.cyan("crbn up")} to boot it`);}diff --git a/packages/dev/src/commands/remove.ts b/packages/dev/src/commands/remove.tsindex dcfc370aa3..6f245913d0 100644--- a/packages/dev/src/commands/remove.ts+++ b/packages/dev/src/commands/remove.ts@@ -79,7 +79,7 @@ export async function removeWorktreeCmd() {title: "Unregister portless aliases",task: async () => {await unregisterAliases(targetPath, branchPrefix);- pruneStaleRoutes(branchPrefix);+ pruneStaleRoutes();return "network stopped";}}diff --git a/setup.sh b/setup.shindex 8d9484f066..beda11d5eb 100755--- a/setup.sh+++ b/setup.sh@@ -148,6 +148,19 @@ crbn() {local outout="\$(command crbn "\$@")" || return \$?[[ -n "\$out" ]] && eval "\$out"+ elif [[ "\${1:-}" == "new" ]]; then+ # \`new\` uses interactive prompts (clack) on stdout, so we can't capture+ # stdout for eval. Instead, the TS code writes the target path to a temp+ # file and we cd after it exits.+ local tmpf="\${TMPDIR:-/tmp}/crbn-new-\$\$"+ CRBN_NEW_TARGET="\$tmpf" command crbn "\$@"+ local rc=\$?+ if [[ \$rc -eq 0 && -f "\$tmpf" ]]; then+ cd "\$(cat "\$tmpf")" && rm -f "\$tmpf"+ else+ rm -f "\$tmpf" 2>/dev/null+ fi+ return \$rcelsecommand crbn "\$@"fi