Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gulp.task('docs', function() {
var docVersion = argv['doc-version'] || 'nightly';
if (docVersion != 'nightly' && !semver.valid(docVersion)) {
console.log('Usage: gulp docs --doc-version=(nightly|versionName)');
return process.exit(1);
}
var config = dgeni.loadConfig(path.resolve(projectRoot, 'config/docs/docs.config.js'));
config.set('currentVersion', docVersion);
config.set(
'rendering.outputFolder',
argv.dist ? argv.dist : path.resolve(projectRoot, '..', 'ionic-site')
);
return dgeni.generator(config)().then(function() {
gutil.log('Docs for', gutil.colors.cyan(docVersion), 'generated!');
});
});
gulp.task('demos', function(done) {
var demoVersion = argv['demo-version'] || 'nightly';
if (demoVersion != 'nightly' && !semver.valid(demoVersion)) {
console.log('Usage: gulp docs --doc-version=(nightly|versionName)');
return process.exit(1);
}
var config = dgeni.loadConfig(path.resolve(projectRoot, 'config/demos/demos.config.js'));
config.set('currentVersion', demoVersion);
config.set('dist', buildConfig.dist);
config.set(
'rendering.outputFolder',
argv.dist ? argv.dist : path.resolve(projectRoot, buildConfig.dist, 'nightly')
);
config.set('demoFolderPrefix', argv.release ? '' : '/dist/ionic-demo');
dgeni.generator(config)().then(function() {
gutil.log('Demos for', gutil.colors.cyan(demoVersion), 'generated!');
gutil.log('Building ionic into demo folder...');
cp.spawn('node', [
projectRoot + '/node_modules/.bin/gulp',
'build',
argv.release ? '--release' : '--no-release',
'--dist=' + config.rendering.outputFolder + '/' +