Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.log(
chalk.red(figures.cross +' Continuing with branch "' + match[0] + '" (--force)')
)
} else {
// No --force and not on master? -> error message
if (match[0] !== 'master') {
throw new Error(
chalk.red(figures.warning) +
chalk.red.bold(
' You are currently not on branch "master" but on "' + match[0] + '". This is not recommended!')
+ '\n Use --force to continue anyway.'
)
}
console.log(
chalk.green(figures.tick) +
chalk.dim(' You are on branch "master"')
)
}
// return current branch name and remote name
return {
current: match[0],
remote: match[1] ? match[1].trim().replace(/\0/g, '') : ''
}
})
}
}
// STEP 4: EMIT
if ( progress >= 0.95 && progress < 1 ) {
// Skip if we jumped back a step, else update the step counter
if ( previousStep > 4 ) {
return;
}
previousStep = 4;
logLines.push( chalk.white( ` ${ figures.pointer } Emit files` ) );
} else if ( progress === 1 ) {
logLines.push( chalk.green( ` ${ figures.tick } Emit files` ) );
}
// STEP 5: FOOTER
if ( progress === 1 ) {
// Calculate process time
previousStep = 0;
const finishTime = new Date().getTime();
const processTime = ( ( finishTime - startTime ) / 1000 ).toFixed( 3 );
logLines.push( chalk.white( `\nWebpack: Finished after ${ processTime } seconds.\n` ) );
}
// Finally, let's bring those logs to da screen
async generateBundle(outputOptions, bundle, isWrite) {
for (const fileName in bundle) {
const entry = bundle[fileName]
console.log(
`${chalk.green(figures.tick)} Written: ${chalk.green(
path.relative(root, outputOptions.file)
)} in ${chalk.blue(formatDuration(start))} [${prettyBytes(entry.code.length)}]`
)
}
}
}
const format = getFormatOpt(opts);
if (!opts.outFile && !opts.outDir) {
generate(inputPaths, (dbml) => exporter.export(dbml, format), OutputConsolePlugin);
} else if (opts.outFile) {
const header = [
'-- SQL dump generated using DBML (dbml-lang.org)\n',
`-- Database: ${config[format].name}\n`,
`-- Generated at: ${new Date().toISOString()}\n\n`,
].join('');
generate(inputPaths, (dbml) => exporter.export(dbml, format),
new OutputFilePlugin(resolvePaths(opts.outFile), header));
console.log(` ${chalk.green(figures.tick)} Generated SQL dump file (${config[format].name}): ${path.basename(opts.outFile)}`);
}
} catch (err) {
logger.error(err);
}
}
let total = files.reduce((sum, f, i) => {
try {
if (dryRun) {
accessSync(f.name, W_OK)
} else {
rimraf.sync(f.name)
}
console.log(chalk.green(`${figures.tick} ${pad(stats[i].hsize)} ${f.name}`))
return sum + stats[i].size
} catch (e) {
console.error(chalk.red(`${figures.cross} ${f.name}`))
console.error(chalk.red(` ${e.message}`))
return sum
}
}, 0)
console.log(chalk.bold(`Total: ${filesize(total)}`))
changelogFileStream.on( 'finish', () => {
console.log( chalk.green( ` ${ figures.tick } Generated changelog, then placed it within the "CHANGELOG.md" file.` ) );
resolve();
} );
function getMutationRepresentation(state) {
if (state === '0') {return chalk.green(`${figures.tick}`);}
return chalk.red(`${figures.cross}`);
}
function getColorFnAndIconByType (type) {
let colorFn, icon
switch (type) {
case 'error':
colorFn = chalk.red
icon = figures.cross
break
case 'warn':
colorFn = chalk.yellow
icon = figures.warning
break
case 'success':
colorFn = chalk.green
icon = figures.tick
break
default:
colorFn = chalk.blue
icon = figures.info
break
}
return { colorFn, icon }
}
icon = chalk.grey(figures.circleDotted);
}
if (currentState === STATE_CLEANING) {
message = chalk.grey('cleaning up');
icon = chalk.grey(figures.circleDotted);
}
if (currentState === STATE_RUNNING) {
message = chalk.grey('running');
icon = chalk.grey(figures.circleDotted);
}
if (currentState === STATE_SUCCESS) {
message = chalk.green('success');
icon = chalk.green(figures.tick);
}
if (currentState === STATE_ERROR) {
message = chalk.red('error');
icon = chalk.red(figures.cross);
}
items.push([icon, ` ${version}: `, message]);
}
return '\n' + indentString(table(items, {hsep: ''}), 1);
};
logLevel: 'info'
},
info: {
badge: figures.info,
color: 'blue',
label: 'info',
logLevel: 'info'
},
star: {
badge: figures.star,
color: 'yellow',
label: 'star',
logLevel: 'info'
},
success: {
badge: figures.tick,
color: 'green',
label: 'success',
logLevel: 'info'
},
wait: {
badge: figures.ellipsis,
color: 'blue',
label: 'waiting',
logLevel: 'info'
},
warn: {
badge: figures.warning,
color: 'yellow',
label: 'warning',
logLevel: 'warn'
},