| 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); |