Skip to content

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.

lint: fix

Sidwebworksc2887113289b
diff --git a/packages/dev/bin/crbn b/packages/dev/bin/crbn
index 621b68b773..d0dda2e062 100755
--- a/packages/dev/bin/crbn
+++ b/packages/dev/bin/crbn
@@ -205,7 +205,7 @@ cmd_checkout() {
target="$parent/${base}-$(slugify_branch "$name")"
fi
- local local_exists=0 origin_exists=0 existing_worktree=""
+ local local_exists=0 existing_worktree=""
if git -C "$root" show-ref --verify --quiet "refs/heads/$name"; then
local_exists=1
fi
@@ -260,13 +260,11 @@ cmd_checkout() {
&& git -C "$root" show-ref --verify --quiet "refs/remotes/origin/$name"; then
git -C "$root" branch --track "$name" "origin/$name" >&2
resolved="$name"
- origin_exists=1
else
fail "branch '$name' not found locally or on origin (use -b to create)"
exit 1
fi
fi
- : "$origin_exists" # tracked for clarity; not used after this
if [[ -e "$target" ]]; then
fail "target path already exists: $target"
diff --git a/packages/dev/src/commands/down.ts b/packages/dev/src/commands/down.ts
index c9c8eb4cb6..388fe2b1bf 100644
--- a/packages/dev/src/commands/down.ts
+++ b/packages/dev/src/commands/down.ts
@@ -1,7 +1,7 @@
import { intro, outro, tasks } from "@clack/prompts";
import pc from "picocolors";
import { syncAppPortlessConfigs } from "../env.js";
-import { currentBranch, isLinkedWorktree } from "../git.js";
+import { currentBranch } from "../git.js";
import { stopStack } from "../services/compose.js";
import { branchToPrefix, unregisterAliases } from "../services/portless.js";
import { getWorktreeRoot, projectName, resolveSlug } from "../worktree.js";
@@ -37,14 +37,9 @@ export async function down(opts: { silent?: boolean } = {}) {
}
},
{
- title: "Reset app portless.json",
+ title: "Clean up portless.json",
task: async () => {
- const linked = await isLinkedWorktree();
- syncAppPortlessConfigs({
- worktreeRoot: root,
- branchPrefix: null,
- linked
- });
+ syncAppPortlessConfigs(root);
return "configs reset";
}
}
@@ -68,8 +63,7 @@ async function runPlain(root: string, slug: string, project: string) {
await unregisterAliases(root, branchPrefix);
done("aliases removed");
- step("resetting app portless.json");
- const linked = await isLinkedWorktree();
- syncAppPortlessConfigs({ worktreeRoot: root, branchPrefix: null, linked });
+ step("cleaning up portless.json");
+ syncAppPortlessConfigs(root);
done("configs reset");
}
diff --git a/packages/dev/src/commands/up.ts b/packages/dev/src/commands/up.ts
index f88682d46d..6236acd82f 100644
--- a/packages/dev/src/commands/up.ts
+++ b/packages/dev/src/commands/up.ts
@@ -4,7 +4,7 @@ import { execa } from "execa";
import { join } from "pathe";
import type { AppId } from "../constants.js";
import { renderEnv, syncAppPortlessConfigs, writeEnv } from "../env.js";
-import { currentBranch, isLinkedWorktree } from "../git.js";
+import { currentBranch } from "../git.js";
import { onShutdown } from "../helpers.js";
import { pickApps, pickBorrowSlug } from "../prompts.js";
import {
@@ -239,21 +239,13 @@ async function provisionSlot(
jwt: borrowedEntry.jwt
}
: ownSlot;
- // Prefix every non-default branch. Portless auto-prefixes only in
- // linked worktrees; main checkout gets the same shape via per-app
- // portless.json stamped below.
const branch = await currentBranch(root);
- const linked = await isLinkedWorktree();
const branchPrefix = branchToPrefix(branch, slug);
ctx = { root, slug, branchPrefix, ...slot };
writeEnv(root, renderEnv({ slug, portless, branchPrefix, ...slot }));
- syncAppPortlessConfigs({
- worktreeRoot: root,
- branchPrefix: portless ? branchPrefix : null,
- linked
- });
+ syncAppPortlessConfigs(root);
// Use override: true so freshly written .env.local values replace any
// stale values already in process.env from the initial load at startup.
loadDotenv({ path: join(root, ".env.local"), override: true });
diff --git a/packages/dev/src/env.ts b/packages/dev/src/env.ts
index faff0ccd3c..7e6966e693 100644
--- a/packages/dev/src/env.ts
+++ b/packages/dev/src/env.ts
@@ -90,15 +90,7 @@ export function writeEnv(worktreeRoot: string, content: string) {
writeFileSync(join(worktreeRoot, ".env.local"), content);
}
-// Remove leftover portless.json files — apps are no longer spawned via
-// `portless run` (which auto-prefixed linked worktrees in the wrong order).
-// Instead, apps are spawned directly and registered via `portless alias`.
-export function syncAppPortlessConfigs(opts: {
- worktreeRoot: string;
- branchPrefix: string | null;
- linked: boolean;
-}) {
- const { worktreeRoot } = opts;
+export function syncAppPortlessConfigs(worktreeRoot: string) {
for (const { value: appId } of APP_CHOICES) {
const path = join(worktreeRoot, "apps", appId, "portless.json");
if (existsSync(path)) {