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('verify', function() {
return obt.verify(gulp, {
// Files to exclude from Origami verify
excludeFiles: [
'!server/**', // Server side code
'!client/admin/scss/lib/**' //
]
});
});
function build(app) {
return obt.build(gulp, {
js: './client/'+app+'/js/main.js',
sass: './client/'+app+'/scss/main.scss',
buildJs: 'bundle.js',
buildCss: 'bundle.css',
buildFolder: 'public/build/'+app
});
}
return new Promise((resolve, reject) => {
const log = this.log;
const demoConfig = {
dist: true,
demoFilter: options.demoName,
cwd: installation.getComponentDir(options.moduleName),
brand: options.brand
};
log.trace(demoConfig, 'Starting OBT Demo build');
const demoStream = obt.demo(gulp, demoConfig);
const filesGenerated = [];
demoStream.on('data', function(file) {
log.trace('OBT demo compiling');
filesGenerated.push(file);
});
demoStream.on('end', () => {
if (filesGenerated.length > 0) {
log.trace(demoConfig, 'OBT Demo build complete');
const html = filesGenerated[0].contents.toString('utf8');
const versionLockedContent = this.fileProxy.versionLockBuildserviceUrls(html, options.moduleName, options.moduleVersion, 'https://' + hostnames.preferred + options.reqUrl);
resolve(new Buffer(versionLockedContent));
} else {
reject(new CompileError('No file were generated running obt.demo'));