function getCacheDir(optPath) {
  const dir = findCacheDir({name: 'gh-pages'});
  if (!optPath) {
    return dir;
  }

  return path.join(dir, filenamify(optPath));
}
Get the cache directory.
@param {string} [optPath] Optional path.
@return {string} The full path to the cache directory.