版博士V2.0程序
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

23 linhas
459 B

  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. 'use strict';
  8. var path = require('path');
  9. var expand = require('expand-tilde');
  10. var gm = require('global-modules');
  11. module.exports = function resolveDir(dir) {
  12. if (dir.charAt(0) === '~') {
  13. dir = expand(dir);
  14. }
  15. if (dir.charAt(0) === '@') {
  16. dir = path.join(gm, dir.slice(1));
  17. }
  18. return dir;
  19. };