MCPcopy Create free account
hub / github.com/block/buzz / expandTilde

Function expandTilde

desktop/src/features/workspaces/workspaceStorage.ts:14–28  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

12 * input returns `undefined` so callers can clear the override.
13 */
14export async function expandTilde(input: string): Promise<string | undefined> {
15 const trimmed = input.trim();
16 if (!trimmed) {
17 return undefined;
18 }
19 if (trimmed === "~") {
20 return homeDir();
21 }
22 if (trimmed.startsWith("~/")) {
23 const home = await homeDir();
24 const base = home.endsWith("/") ? home.slice(0, -1) : home;
25 return `${base}/${trimmed.slice(2)}`;
26 }
27 return trimmed;
28}
29
30export function loadWorkspaces(): Workspace[] {
31 try {

Callers 2

EditWorkspaceDialogFunction · 0.90
AddWorkspaceDialogFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected