转换目录文件define id为basepath 相对路径,转换替换所有匹配alias 原则上alias不自动生成了，还是以用户自定义为准
423848
function transform(dir, basepath,ignore) {
	ignore = ignore || [];
	basepath = basepath || options.basepath || pwd;
	hfs.walk(dir, function(files) {
		var allrquires = [];
		files.forEach(function(file) {
			var filename = file;
			file = fs.readFileSync(path.resolve(pwd, file)).toString().replace(commentRegExp, "");
			var isLitheJs = !! file.match(defineRegexp);
			if (isLitheJs) {
				//替换define
				var id = filename.replace(basepath, '').replace(/\.js$/, '');
				file = file.replace(defineRegexp, function($1, $2) {
					return 'define("' + id + '"';
				});
                //转义require
                file = file.replace(requireRegexp,function($1,$2){
                    var newrequire = path.join(dir,$2).replace(basepath,'');
                    return 'require("'+newrequire+'")';     
                });
				hfs.writeFileSync(filename, file);
			}
		});
	},
	{
		filter: function(el) {
			var ext = path.extname(el);
			if (inIgnore(ignore, el) && ext.indexOf('.json') == - 1 && ext.indexOf('.js') > - 1) return true;
		}
	});
}
1324924
def base_path(self):
        """"""
        return os.path.join(self.conn.abs_root, self.name)
1151343
def create_prefix_dir(self, path, fmt):
        """"""
        create_prefix_dir(self._get_os_path(path.strip('/')), fmt)
745438
def ParentAndBaseName(path):
  """"""
  dirname, basename = os.path.split(path)
  dirname = dirname.rstrip(os.path.sep)
  if os.path.altsep:
    dirname = dirname.rstrip(os.path.altsep)
  _, parentname = os.path.split(dirname)
  return os.path.join(parentname, basename)
590511
def BasenamePath(self, path):
    
    if path.endswith(self.PATH_SEPARATOR):
      path = path[:-1]
    _, _, basename = path.rpartition(self.PATH_SEPARATOR)
    return basename
1183673
function getBasename(relativePath) {
    const mayBeSuffix = [".ts", ".tsx", ".d.ts"];
    let mayBePath = relativePath;
    mayBeSuffix.map(suffix => {
        const tmpPath = path_1.default.basename(relativePath, suffix);
        if (tmpPath.length < mayBePath.length) {
            mayBePath = tmpPath;
        }
    });
    // Return whichever path is shorter. If they're the same length then nothing was stripped.
    return mayBePath;
}
693428
public static String generateDbPath(String baseDir, String dbName) {
    return PathUtils.concatPath(baseDir, dbName);
  }
265455
def basename(self, suffix=''):
		''' '''
		return os.path.basename(self._file, suffix) if self._file else None
102989
private File getBaseDir( File path)
    {
    return
      path == null?
      baseDir_ :
      
      path.isAbsolute()?
      path :

      new File( baseDir_, path.getPath());
    }
189246
function (base, path, noStartingSlash) {

        if (base === path) {
            return '';
        }

        // Sanitize inputs, convert windows to posix style slashes, ensure trailing slash for base
        base = base.replace(/^[a-z]:/i, '').replace(/\\/g, '/').replace(/\/$/g, '') + '/';
        path = path.replace(/^[a-z]:/i, '').replace(/\\/g, '/');
        // console.log(' ==== '+path);
        // Only truncate paths that overap with the base
        if (base === path.substr(0, base.length)) {
            path = '/' + path.substr(base.length);
        }

        var modifyStartingSlash = noStartingSlash !== undefined;

        if(modifyStartingSlash) {
            if (path[0] === '/' && noStartingSlash) {
                path = path.substr(1);
            } else if (path[0] !== '/' && !noStartingSlash){
                path = '/' + path;
            }
        }

        return path;

    }
405893
function(basePath, config) {
    this._basePath = basePath;
    this._config = config;

    var directories = IOUtils.getDirectoryList(basePath, false);
    IOUtils.createPathIfNotExists(directories, './');
}
599068
function getBaseName(fullPath) {
        var lastSlash = fullPath.lastIndexOf("/");
        if (lastSlash === fullPath.length - 1) {  // directory: exclude trailing "/" too
            return fullPath.slice(fullPath.lastIndexOf("/", fullPath.length - 2) + 1, -1);
        } else {
            return fullPath.slice(lastSlash + 1);
        }
    }
770168
def full_path(base, fmt):
    """"""
    ext = fmt['extension']
    suffix = fmt.get('suffix')
    prefix = fmt.get('prefix')

    full = base

    if prefix:
        prefix_dir, prefix_file_name = os.path.split(prefix)
        notebook_dir, notebook_file_name = os.path.split(base)

        # Local path separator (\\ on windows)
        sep = base[len(notebook_dir):-len(notebook_file_name)] or '/'
        prefix_dir = prefix_dir.replace('/', sep)

        if prefix_file_name:
            notebook_file_name = prefix_file_name + notebook_file_name

        if prefix_dir:
            # Do not add a path separator when notebook_dir is '/'
            if notebook_dir and not notebook_dir.endswith(sep):
                notebook_dir = notebook_dir + sep
            notebook_dir = notebook_dir + prefix_dir

        if notebook_dir and not notebook_dir.endswith(sep):
            notebook_dir = notebook_dir + sep

        full = notebook_dir + notebook_file_name

    if suffix:
        full = full + suffix

    return full + ext
1228043
function mergePath(options, deps, base) {
    return deps.map(function (item) {
        var origId = item.origId;

        // 防止多次merge
        if (item.path) {
            return;
        }
        origId = margeConfig(options, origId);
        return {
            id: item.id,
            extName: item.extName,
            path: origId.slice(0, 4) === 'http' || origId.slice(0, 2) === '//' ? origId : path.resolve(base, origId),
            origId: origId
        };
    });
}
432921
protected function basepath()
    {
        $directory = new \RecursiveDirectoryIterator(getcwd());

        $iterator = new \RecursiveIteratorIterator($directory);

        foreach ($iterator as $item) {
            $core = 'core' . DIRECTORY_SEPARATOR . 'CodeIgniter.php';

            $exists = strpos($item->getPathname(), $core) !== false;

            $path = str_replace($core, '', $item->getPathname());

            $exists && ! defined('BASEPATH') && define('BASEPATH', $path);
        }
    }
202149
function resolveNewPath(newBase) {
    return mapSync(file => {
      file.cwd += newBase;
      file.base = file.cwd;
      return file;
    });
  }
1295795
@SuppressWarnings({ "rawtypes", "unchecked" })
    public boolean setDocBase(String basePath)
    {
        proxyDirContext = null;
        if (basePath == null)
            return false;
        Hashtable env = new Hashtable();
                    
        File file = new File(basePath);
        if (!file.exists())
            return false;
        if (!file.isDirectory())
            return false;
      
        env.put(ProxyDirContext.CONTEXT, file.getPath());
        FileDirContext fileContext = new FileDirContext(env);
        fileContext.setDocBase(file.getPath());
        proxyDirContext = new ProxyDirContext(env, fileContext);
          /* Can't figure this one out
        InitialContext cx = null;
          try {
              cx.rebind(RESOURCES_JNDI_NAME, obj);
          } catch (NamingException e) {
              e.printStackTrace();
          }
          */
        // Load the proxy dir context.
        return true;
    }