function copyStaticFile(filepath, staticPath) {
        var relativePath = staticPath ? path.normalize(filepath.replace(staticPath, '')) : filepath;
        var toDir;

        if (relativePath.indexOf(path.sep) === 0) {
            relativePath = relativePath.substr(1);
        }
        toDir = fs.toDir(path.resolve(destination, relativePath));

        self.createOutputDirectory(path.resolve(destination, toDir));
        logger.debug('Copying static file %s to %s', path.relative(self.template.path, filepath),
            toDir);
        fs.copyFileSync(filepath, toDir);
    }
Exemple #2
0
 sourceFiles = sourceFiles.map(function($) {
     return path.relative(env.pwd, $);
 });