MCPcopy
hub / github.com/witheve/Eve / getWorkspaceFromPath

Function getWorkspaceFromPath

src/runtime/eveSource.ts:71–81  ·  view source on GitHub ↗
(file:string)

Source from the content-addressed store, hash-verified

69
70
71export function getWorkspaceFromPath(file:string):string|undefined {
72 var parts = file.split("/");
73 var basename = parts.pop();
74 var workspace = parts[1];
75 if(!basename || !workspace) return;
76 if(!workspaces[workspace]) {
77 console.error(`Unable to get '${file}' from unregistered workspace '${workspace}'`);
78 }
79
80 return workspace;
81}
82
83export function getRelativePath(file:string, workspace:string):string|undefined {
84 let directory = workspaces[workspace];

Callers 2

findFunction · 0.85
saveFunction · 0.85

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected