tasks/sonar.js
function copyFiles(g, defaultOutputDir, targetDir) {
            var files = glob.sync(g.src.toString(), {cwd: g.cwd, root: '/'});
            files.forEach(function (file) {
                var destinationDirectory = defaultOutputDir + path.sep + targetDir;
                var fileDirectory = path.dirname(file);
                if (fileDirectory !== '.') {
                    destinationDirectory = destinationDirectory + path.sep + fileDirectory;
                }
                fs.mkdirpSync(destinationDirectory);
                var source = path.resolve(g.cwd, file);
                var extension = path.extname(file);
                var destination;
                if (targetDir === 'test') {
                    var base = path.basename(file, extension);
                    if (extension === '.js') {
                        destination = destinationDirectory + path.sep + path.basename(base.replace(/\./g, '_') + extension);
                    } else if (extension === '.feature') {
                        destination = destinationDirectory + path.sep + path.basename(base.concat(extension).replace(/\./g, '_') + '.js');
                    }
                } else {
                    destination = destinationDirectory + path.sep + path.basename(file);
                }

                fs.copySync(source, destination, {replace: true});
            });
        }
function copyFiles(g, defaultOutputDir, targetDir) {
            var files = glob.sync(g.src.toString(), {cwd: g.cwd, root: '/'});
            files.forEach(function (file) {
                var destinationDirectory = defaultOutputDir + path.sep + targetDir;
                var fileDirectory = path.dirname(file);
                if (fileDirectory !== '.') {
                    destinationDirectory = destinationDirectory + path.sep + fileDirectory;
                }
                fs.mkdirpSync(destinationDirectory);
                var source = path.resolve(g.cwd, file);
                var extension = path.extname(file);
                var destination;
                if (targetDir === 'test') {
                    var base = path.basename(file, extension);
                    if (extension === '.js') {
                        destination = destinationDirectory + path.sep + path.basename(base.replace(/\./g, '_') + extension);
                    } else if (extension === '.feature') {
                        destination = destinationDirectory + path.sep + path.basename(base.concat(extension).replace(/\./g, '_') + '.js');
                    }
                } else {
                    destination = destinationDirectory + path.sep + path.basename(file);
                }

                fs.copySync(source, destination, {replace: true});
            });
        }
function copyFiles ( g , defaultOutputDir , targetDir ) { var files = glob . sync ( g . src . toString ( ) , { cwd : g . cwd , root : '/' } ) ; files . forEach ( function ( file ) { var destinationDirectory = defaultOutputDir + path . sep + targetDir ; var fileDirectory = path . dirname ( file ) ; if ( fileDirectory !== '.' ) { destinationDirectory = destinationDirectory + path . sep + fileDirectory ; } fs . mkdirpSync ( destinationDirectory ) ; var source = path . resolve ( g . cwd , file ) ; var extension = path . extname ( file ) ; var destination ; if ( targetDir === 'test' ) { var base = path . basename ( file , extension ) ; if ( extension === '.js' ) { destination = destinationDirectory + path . sep + path . basename ( base . replace ( / \. / g , '_' ) + extension ) ; } else if ( extension === '.feature' ) { destination = destinationDirectory + path . sep + path . basename ( base . concat ( extension ) . replace ( / \. / g , '_' ) + '.js' ) ; } } else { destination = destinationDirectory + path . sep + path . basename ( file ) ; } fs . copySync ( source , destination , { replace : true } ) ; } ) ; }
Copy files to the temp directory.
@param g The glob.
Copy files to the temp directory .