Jakefile.js
function copyFiles(dir) {
    var files = fs.readdirSync(srcDir + dir);
    files.forEach(function(file) {
      var currentDir = dir + file;
      if (!regexExcludeFiles.test(currentDir)) {
        var stats = fs.statSync(srcDir + currentDir);
        if (stats.isDirectory()) {
          if (!fs.existsSync(publishDir + currentDir)) {
            fs.mkdirSync(publishDir + currentDir);
          }
          copyFiles(currentDir + "/");
        } else if (stats.isFile()) {
          var contents = fs.readFileSync(srcDir + currentDir);
          fs.writeFileSync(publishDir + currentDir, contents);
        }
      }
    });
  }
function copyFiles(dir) {
    var files = fs.readdirSync(srcDir + dir);
    files.forEach(function(file) {
      var currentDir = dir + file;
      if (!regexExcludeFiles.test(currentDir)) {
        var stats = fs.statSync(srcDir + currentDir);
        if (stats.isDirectory()) {
          if (!fs.existsSync(publishDir + currentDir)) {
            fs.mkdirSync(publishDir + currentDir);
          }
          copyFiles(currentDir + "/");
        } else if (stats.isFile()) {
          var contents = fs.readFileSync(srcDir + currentDir);
          fs.writeFileSync(publishDir + currentDir, contents);
        }
      }
    });
  }
function copyFiles ( dir ) { var files = fs . readdirSync ( srcDir + dir ) ; files . forEach ( function ( file ) { var currentDir = dir + file ; if ( ! regexExcludeFiles . test ( currentDir ) ) { var stats = fs . statSync ( srcDir + currentDir ) ; if ( stats . isDirectory ( ) ) { if ( ! fs . existsSync ( publishDir + currentDir ) ) { fs . mkdirSync ( publishDir + currentDir ) ; } copyFiles ( currentDir + "/" ) ; } else if ( stats . isFile ( ) ) { var contents = fs . readFileSync ( srcDir + currentDir ) ; fs . writeFileSync ( publishDir + currentDir , contents ) ; } } } ) ; }
Recursively copies all files that dont match the exclude filter from the
base directory to the publish directory.
Recursively copies all files that dont match the exclude filter from the base directory to the publish directory .