示例#1
0
	    private static FilePath FindScript(FilePath path, string file)
	    {
            var searchPath = path.File(file);
	        if (File.Exists(searchPath.Path))
	        {
                return searchPath;
	        }
            searchPath = path.Directory("Scripts").File(file);
            if (File.Exists(searchPath.Path)) {
                return searchPath;
            }
            var parent = path.Parent;
            if (parent == null)
            {
                return null;
            }
            return FindScript(parent, file);
	    }
示例#2
0
        private static FilePath FindScript(FilePath path, string file)
        {
            var searchPath = path.File(file);

            if (File.Exists(searchPath.Path))
            {
                return(searchPath);
            }
            searchPath = path.Directory("Scripts").File(file);
            if (File.Exists(searchPath.Path))
            {
                return(searchPath);
            }
            var parent = path.Parent;

            if (parent == null)
            {
                return(null);
            }
            return(FindScript(parent, file));
        }