blob: 3fe536603b3a7ecd9c259b4f02f98d5cffe050bf [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001/*!
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
10var path = require('path');
11var expand = require('expand-tilde');
12var gm = require('global-modules');
13
14module.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};