MCPcopy
hub / github.com/acode/cli / location

Method location

cli/config.js:21–32  ·  view source on GitHub ↗
(depth)

Source from the content-addressed store, hash-verified

19 }
20
21 location (depth) {
22 depth = depth || 0;
23 let loc = process.cwd();
24 let pathnames = loc.split(path.sep);
25 // If Window directory drive, don't add starting "/"
26 let fullpath = pathnames[0].indexOf(':') > -1 ?
27 path.join.apply(path, pathnames.slice(0, pathnames.length - depth)) :
28 path.join.apply(path, ['/'].concat(pathnames.slice(0, pathnames.length - depth)));
29 return this.workspace() &&
30 depth <= pathnames.length &&
31 fullpath.toLowerCase() === this.workspace().toLowerCase();
32 }
33
34 workspace () {
35 return this.get(CONFIG_VAR_WORKSPACE);

Callers 3

runMethod · 0.80
runMethod · 0.80
runMethod · 0.80

Calls 1

workspaceMethod · 0.95

Tested by

no test coverage detected