Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 + '/' +
config.rendering.contentsFolder + '/ionic'
])
.on('exit', done);
});
});
semver = require('semver'),
argv = require('minimist')(process.argv.slice(2)),
docVersion = argv['doc-version'];
if (docVersion != 'unstable' && !semver.valid(docVersion)) {
console.log('Usage: gulp docs --doc-version=(unstable|versionName)');
if(pkg.version) {
console.log('Current package.json version is: '+pkg.version);
}
console.log('No version selected, using unstable');
docVersion = 'unstable';
}
process.env.DOC_VERSION = docVersion;
gutil.log('Generating documentation for ', gutil.colors.cyan(docVersion));
var generateDocs = dgeni.generator('docs-generation/docs.config.js');
return generateDocs().then(function() {
gutil.log('Docs for', gutil.colors.cyan(docVersion), 'generated!');
});
});