Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (/publish.js$/.test(fileName)) return; // Skip self
if (/README.md$/.test(fileName)) return; // Skip own README
if (/\.tmpl$/.test(fileName)) return; // Skip .tmpl files; these are used as partials only
if (!/\.html$/.test(fileName)) {
// Just plain copy over non-html files
var tmpDir = fs.toDir(outFile);
fs.mkPath(tmpDir);
fs.copyFileSync(fileName, tmpDir);
return;
}
// Render html files as templates
//console.log(relName);
var html = renderer.partial(relName, {});
fs.mkPath(fs.toDir(outFile));
fs.writeFileSync(outFile, html, 'utf8');
});
sourceFiles[sourcePath] = {
resolved : sourcePath,
shortened : null
};
sourceFilePaths.push( sourcePath );
}
} );
// update outdir if necessary, then create outdir
var packageInfo = ( find( {kind : 'package'} ) || [] ) [0];
if ( packageInfo && packageInfo.name ) {
outdir = path.join( outdir, packageInfo.name, packageInfo.version );
}
fs.mkPath( outdir );
// copy static files to outdir
var fromDir = path.join( templatePath, 'static' ),
staticFiles = fs.ls( fromDir, 3 );
staticFiles.forEach( function ( fileName ) {
var toDir = fs.toDir( fileName.replace( fromDir, outdir ) );
fs.mkPath( toDir );
fs.copyFileSync( fileName, toDir );
} );
if ( sourceFilePaths.length ) {
var payload = navOptions.sourceRootPath;
if ( !payload ) {
payload = path.commonPrefix( sourceFilePaths );
}
resolved: sourcePath,
shortened: null
}
if (sourceFilePaths.indexOf(sourcePath) === -1) {
sourceFilePaths.push(sourcePath)
}
}
})
// update outdir if necessary, then create outdir
var packageInfo = (find({ kind: "package" }) || [])[0]
// if (packageInfo && packageInfo.name) {
// outdir = path.join(outdir, packageInfo.name, packageInfo.version || "")
// }
fs.mkPath(outdir)
// copy the template's static files to outdir
var fromDir = path.join(templatePath, "static")
var staticFiles = fs.ls(fromDir, 3)
staticFiles.forEach(function(fileName) {
var toDir = fs.toDir(fileName.replace(fromDir, outdir))
fs.mkPath(toDir)
fs.copyFileSync(fileName, toDir)
})
// copy user-specified static files to outdir
var staticFilePaths
var staticFileFilter
var staticFileScanner
if (conf.default.staticFiles) {
createOutputDirectory(relativePath) {
const newPath = relativePath ?
path.resolve(this.destination, relativePath) :
this.destination;
/* istanbul ignore else */
if (!this.outputDirectories[newPath]) {
logger.debug('Creating the output directory %s', newPath);
fs.mkPath(newPath);
this.outputDirectories[newPath] = true;
}
return this;
}
if ( templateConf.uilib ) {
api.library = templateConf.uilib;
}
api.symbols = [];
// sort only a copy(!) of the symbols, otherwise the SymbolSet lookup is broken
symbols.slice(0).sort(sortByAlias).forEach(function(symbol) {
if ( isFirstClassSymbol(symbol) && !symbol.synthetic ) { // dump a symbol if it as a class symbol and if it is not a synthetic symbol
api.symbols.push(createAPIJSON4Symbol(symbol, false));
}
});
postProcessAPIJSON(api);
validateAPIJSON(api);
fs.mkPath(path.dirname(filename));
fs.writeFileSync(filename, JSON.stringify(api), 'utf8');
info(" apiJson saved as " + filename);
}
sourceFiles[sourcePath] = {
resolved: sourcePath,
shortened: null
};
if (sourceFilePaths.indexOf(sourcePath) === -1) {
sourceFilePaths.push(sourcePath);
}
}
});
// update outdir if necessary, then create outdir
var packageInfo = ( find({kind: 'package'}) || [] ) [0];
if (packageInfo && packageInfo.name) {
outdir = path.join(outdir, packageInfo.name, packageInfo.version);
}
fs.mkPath(outdir);
// copy the template's static files to outdir
var fromDir = path.join(templatePath, 'static');
var staticFiles = fs.ls(fromDir, 3);
staticFiles.forEach(function(fileName) {
var toDir = fs.toDir( fileName.replace(fromDir, outdir) );
fs.mkPath(toDir);
fs.copyFileSync(fileName, toDir);
});
// copy user-specified static files to outdir
var staticFilePaths;
var staticFileFilter;
var staticFileScanner;
if (conf['default'].staticFiles) {
staticFiles.forEach(function(fileName) {
var toDir = fs.toDir( fileName.replace(fromDir, outdir) );
fs.mkPath(toDir);
fs.copyFileSync(fileName, toDir);
});
staticFiles.forEach(function(fileName) {
var toDir = fs.toDir( fileName.replace(fromDir, outdir) );
fs.mkPath(toDir);
fs.copyFileSync(fileName, toDir);
});
staticFiles.forEach(function(fileName) {
var toDir = fs.toDir( fileName.replace(fromDir, outdir) );
fs.mkPath(toDir);
fs.copyFileSync(fileName, toDir);
});