MCPcopy Index your code
hub / github.com/witheve/Eve / getRelativePath

Function getRelativePath

src/runtime/eveSource.ts:83–98  ·  view source on GitHub ↗
(file:string, workspace:string)

Source from the content-addressed store, hash-verified

81}
82
83export function getRelativePath(file:string, workspace:string):string|undefined {
84 let directory = workspaces[workspace];
85 if(!directory) {
86 console.error(`Unable to get relative path for '${file}' in unregistered workspace '${workspace}'`);
87 return;
88 }
89
90 if(file.indexOf("./") === 0) {
91 file = file.slice(2);
92 }
93
94 if(file.indexOf(directory) === 0) {
95 file = file.slice(directory.length);
96 }
97 return "/" + workspace + "/" + file;
98}
99
100export function getAbsolutePath(file:string, workspace:string) {
101 let directory = workspaces[workspace];

Callers 2

saveFileFunction · 0.85
fetchFileFunction · 0.85

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected