Resolve path to cover file to use

@param {Output}
@return {String}
348894
function getCoverPath(output) {
    var outputRoot = output.getRoot();
    var book = output.getBook();
    var config = book.getConfig();
    var coverName = config.getValue('cover', 'cover.jpg');

    // Resolve to absolute
    var cover = fs.pickFile(outputRoot, coverName);
    if (cover) {
        return cover;
    }

    // Multilingual? try parent folder
    if (book.isLanguageBook()) {
        cover = fs.pickFile(path.join(outputRoot, '..'), coverName);
    }

    return cover;
}
1054083
function resolveFile(cwd, dir, filename) {
	dir = pathJoin(cwd, dir);

	var filepath = pathJoin(dir, filename);
	var stat = fsStatSync(filepath);

	return stat && {
		cwd: cwd,
		dir: dir,
		path: filepath
	};
}
655187
function resolveDir(directories)
{
  var directoriesAbsPath;

  if (typeOf(directories) == 'array')
  {
    directoriesAbsPath = directories.map(function(d)
    {
      return path.resolve(d);
    }).join('|');
  }
  else
  {
    directoriesAbsPath = path.resolve(directories);
  }

  return directoriesAbsPath;
}
204759
function resolveAbsolute(base, filePath) {
	return getBasePath(base)
	.then(basePath => new Promise((resolve, reject) => {
		filePath = filePath.replace(reAbsolute, '');

		const next = ctx => {
			tryFile(path.resolve(ctx, filePath))
			.then(resolve, () => {
				const dir = path.dirname(ctx);
				if (!dir || dir === ctx) {
					return reject(`Unable to locate absolute file ${filePath}`);
				}

				next(dir);
			});
		};

		next(basePath);
	}));
}
495510
function fullPath(file, base) {
  if (!path.extname(file)) file += '.js'
  base = base ? path.dirname(base) : process.cwd()
  return path.resolve(base, file)
}
761404
def get_output(file)
      file_dir = File.dirname(file)
      file_name = File.basename(file).split('.')[0..-2].join('.')

      file_name = "#{file_name}.js" if file_name.match("\.js").nil?

      file_dir = file_dir.gsub(Regexp.new("#{@options[:input]}(\/){0,1}"), '') if @options[:input]
      file_dir = File.join(@options[:output], file_dir) if @options[:output]

      if file_dir == ''
        file_name
      else
        File.join(file_dir, file_name)
      end
    end
1134537
function resolveFile(file) {
  const files = [file];
  const fileDir = path.dirname(require.resolve(file));
  const fileData = fs.readFileSync(file).toString();
  const regexp = /require\(['|"](.*)['|"]\)/g;

  while (regexp.exec(fileData) !== null) {
    const moduleFile = RegExp.$1;
    if (!isNativeModule(moduleFile)) {
      const modulePath = path.join(fileDir, moduleFile);
      files.push(require.resolve(modulePath));
    }
  }

  return files;
}
516684
function(config) {

    config = config || extend(false, {}, defaults);

    /*--------------
       File Paths
    ---------------*/

    var
      configPath = this.getPath(),
      sourcePaths = {},
      outputPaths = {},
      folder
    ;

    // resolve paths (config location + base + path)
    for(folder in config.paths.source) {
      if(config.paths.source.hasOwnProperty(folder)) {
        sourcePaths[folder] = path.resolve(path.join(configPath, config.base, config.paths.source[folder]));
      }
    }
    for(folder in config.paths.output) {
      if(config.paths.output.hasOwnProperty(folder)) {
        outputPaths[folder] = path.resolve(path.join(configPath, config.base, config.paths.output[folder]));
      }
    }

    // set config paths to full paths
    config.paths.source = sourcePaths;
    config.paths.output = outputPaths;

    // resolve "clean" command path
    config.paths.clean = path.resolve( path.join(configPath, config.base, config.paths.clean) );

    /*--------------
        CSS URLs
    ---------------*/

    // determine asset paths in css by finding relative path between themes and output
    // force forward slashes

    config.paths.assets = {
      source       : '../../themes', // source asset path is always the same
      uncompressed : './' + path.relative(config.paths.output.uncompressed, config.paths.output.themes).replace(/\\/g, '/'),
      compressed   : './' + path.relative(config.paths.output.compressed, config.paths.output.themes).replace(/\\/g, '/'),
      packaged     : './' + path.relative(config.paths.output.packaged, config.paths.output.themes).replace(/\\/g, '/')
    };

    /*--------------
       Permission
    ---------------*/

    if(config.permission) {
      config.hasPermissions = true;
    }
    else {
      // pass blank object to avoid causing errors
      config.permission     = {};
      config.hasPermissions = false;
    }

    /*--------------
         Globs
    ---------------*/

    if(!config.globs) {
      config.globs = {};
    }

    // remove duplicates from component array
    if(config.components instanceof Array) {
      config.components = config.components.filter(function(component, index) {
        return config.components.indexOf(component) == index;
      });
    }

    // takes component object and creates file glob matching selected components
    config.globs.components = (typeof config.components == 'object')
      ? (config.components.length > 1)
        ? '{' + config.components.join(',') + '}'
        : config.components[0]
      : '{' + defaults.components.join(',') + '}'
    ;

    return config;

  }
263556
function (vinyl) {
    return path.extname(vinyl.path) === ".lnxs" ? options.spec.dir : options.output;
  }
1136299
function resolveApp(dir) {
  if (path.isAbsolute(dir)) return dir;
  return path.join(process.cwd(), dir);
}
209552
function resolveOutputTarget(customPath, filename) {
    const realPath = path.resolve('.', customPath);

    const getPath = tryCatch(
        realPath => fs.lstatSync(realPath).isDirectory()
            ? path.join(realPath, filename)
            : realPath,
        identity);

    return getPath(realPath);
}
795733
def __output_path(toolchain, rule, output_dir):
    """"""
    filename = '%s_%s.json' % (toolchain, rule)
    return os.path.join(output_dir, filename)
461977
protected function resolve_file_path($file = null)
    {
        if (is_null($file)) {
            $file = $this->args->file;
        }

        if (file_exists($file)) {
            return $file;
        }

        $dirname  = dirname($file);
        $filename = basename($file);
        $relpath  = $dirname ? "/$dirname" : '';
        $path     = getcwd() . "$relpath/$filename";

        /**
         * realpath will return false if path does not exist
         */
        return realpath($path) ?: str_replace('/./', '/', $path);
    }
205077
function resolveTemplateFiles(name) {
    // Create paths for resolving
    var customFile = customDir + '/' + name + '.js',
        customTemplateDir = customDir + '/' + name + '/**/*',
        stdFile = stdDir + '/' + name + '.js',
        stdTemplateDir = stdDir + '/' + name + '/**/*';

    // Grab any and all files
    var customFiles = expandFiles(customFile).concat(expandFiles(customTemplateDir)),
        stdFiles = expandFiles(stdFile).concat(expandFiles(stdTemplateDir));

    // Generate a hash of files
    var fileMap = {};

    // Iterate over the customFiles
    customFiles.forEach(function (file) {
      // Extract the relative path of the file
      var relPath = path.relative(customDir, file);

      // Save the relative path
      fileMap[relPath] = file;
    });

    // Iterate over the stdFiles
    stdFiles.forEach(function (file) {
      // Extract the relative path of the file
      var relPath = path.relative(stdDir, file),
          overrideExists = fileMap[relPath];

      // If it does not exist, save it
      if (!overrideExists) {
        fileMap[relPath] = file;
      }
    });

    // Return the fileMap
    return fileMap;
  }
1019272
function resolveScripts(file, pathes) {
    var filePath = file.path,
        scriptsStr = '';

    for(var i = 0, len = pathes.length; i < len; i ++) {
        scriptsStr += '<script defer src="' + path.relative(path.dirname(filePath), pathes[i]) + '"></script>\r\n';
    }

    return scriptsStr;
}
808320
function getOutputFile(file, outputDir) {
  const fileName = path.basename(file).replace('.scss', '.css');
  return path.join(outputDir, fileName);
}
220668
function globFile (file) {
    return stat(file).then(({ err, stats }) => {
      if (err) throw err
      if (stats.isDirectory()) {
        // TODO what if file is already slash-terminated?
        switch (file) {
          case './':
            return globPromise('./*.js')
          case 'bin':
            return globPromise('bin/*')
          default:
            return globPromise(`${file}/**/*.js`)
        }
      } else {
        return Promise.resolve(file)
      }
    })
  }