aswi2020vldc-gitlab/templetes/node_modules/resolve-dir/index.js @ 9bb1e829
1 |
/*!
|
---|---|
2 |
* resolve-dir <https://github.com/jonschlinkert/resolve-dir>
|
3 |
*
|
4 |
* Copyright (c) 2015, Jon Schlinkert.
|
5 |
* Licensed under the MIT License.
|
6 |
*/
|
7 |
|
8 |
'use strict'; |
9 |
|
10 |
var path = require('path'); |
11 |
var expand = require('expand-tilde'); |
12 |
var gm = require('global-modules'); |
13 |
|
14 |
module.exports = function resolveDir(dir) { |
15 |
if (dir.charAt(0) === '~') { |
16 |
dir = expand(dir); |
17 |
}
|
18 |
if (dir.charAt(0) === '@') { |
19 |
dir = path.join(gm, dir.slice(1)); |
20 |
}
|
21 |
return dir; |
22 |
};
|