How to use the hexo-fs.copyDir function in hexo-fs

To help you get started, we’ve selected a few hexo-fs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hexojs / hexo-cli / lib / console / init.js View on Github external
function copyAsset(target) {
  return fs.copyDir(ASSET_DIR, target, { ignoreHidden: false });
}
github jaredly / hexo-admin / update.js View on Github external
fs.exists(assetPrev).then(function(exist) {
          if (exist) {
            fs.copyDir(assetPrev, assetDest).then(function() {
              fs.rmdir(assetPrev);
            });
          }
        });
      }
github hexojs / hexo-deployer-git / lib / deployer.js View on Github external
const extendPath = pathFn.join(baseDir, dir);
      const extendDist = pathFn.join(deployDir, dir);

      if (typeof ignoreHidden === 'object') {
        opts.ignoreHidden = ignoreHidden[dir];
      } else {
        opts.ignoreHidden = ignoreHidden;
      }

      if (typeof ignorePattern === 'string') {
        opts.ignorePattern = new RegExp(ignorePattern);
      } else if (typeof ignorePattern === 'object' && Reflect.apply(Object.prototype.hasOwnProperty, ignorePattern, [dir])) {
        opts.ignorePattern = new RegExp(ignorePattern[dir]);
      }

      return fs.copyDir(extendPath, extendDist, opts);
    };
github hexojs / hexo / lib / hexo / post.js View on Github external
return fs.exists(assetSrc).then(exist => {
      if (!exist) return;

      return fs.copyDir(assetSrc, assetDest).then(() => fs.rmdir(assetSrc));
    });
  }).thenReturn(result).asCallback(callback);
github hexojs / hexo-deployer-git / lib / deployer.js View on Github external
}).then(() => {
    const opts = {};
    log.info('Copying files from public folder...');
    if (typeof ignoreHidden === 'object') {
      opts.ignoreHidden = ignoreHidden.public;
    } else {
      opts.ignoreHidden = ignoreHidden;
    }

    if (typeof ignorePattern === 'string') {
      opts.ignorePattern = new RegExp(ignorePattern);
    } else if (typeof ignorePattern === 'object' && Reflect.apply(Object.prototype.hasOwnProperty, ignorePattern, ['public'])) {
      opts.ignorePattern = new RegExp(ignorePattern.public);
    }

    return fs.copyDir(publicDir, deployDir, opts);
  }).then(() => {
    log.info('Copying files from extend dirs...');