refactor: rename services to scripts and extract reusable components

This commit is contained in:
Mohamed Boudra
2026-04-09 18:54:25 +07:00
parent 5cf806dc77
commit 397d454de0
48 changed files with 1356 additions and 983 deletions
@@ -0,0 +1,13 @@
import { slugify } from "./worktree.js";
export function buildScriptHostname(branchName: string | null, scriptName: string): string {
const serviceHostnameLabel = slugify(scriptName);
const isDefaultBranch =
branchName === null || branchName === "main" || branchName === "master";
if (isDefaultBranch) {
return `${serviceHostnameLabel}.localhost`;
}
return `${slugify(branchName)}.${serviceHostnameLabel}.localhost`;
}