(file:string)
| 69 | |
| 70 | |
| 71 | export 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 | |
| 83 | export function getRelativePath(file:string, workspace:string):string|undefined { |
| 84 | let directory = workspaces[workspace]; |