refactor: rename services to scripts and extract reusable components
This commit is contained in:
@@ -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`;
|
||||
}
|
||||
Reference in New Issue
Block a user