Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const success = (src, dest, mode) => {
console.log(`(${name}) '${green(src)}' -> '${green(dest)}' (${green(tick)})`); // eslint-disable-line no-console
if (mode) {
console.log(`(${name}) mode set to ${green(mode)} on '${green(dest)}' (${green(tick)})`); // eslint-disable-line no-console
}
};
}).start();
if (alreadyGenerated) await query`UPDATE redirect_keys SET content = ${hash}`;
else await query`INSERT INTO redirect_keys (content) VALUES (${hash})`;
await clipboardy.write(mnemonic);
storeSpinner.succeed();
console.log();
console.log(
c.green('√ '),
'Your passphrase has been stored, and is now ready to use when micro-link is deployed!',
'\n'
);
console.log(' ', c.green('Your passphrase is:'));
console.log(' ', c.bold(mnemonic));
console.log('\n ', c.green('It has also been copied to your clipboard.'));
process.exit(0);
}
if (alreadyGenerated) await query`UPDATE redirect_keys SET content = ${hash}`;
else await query`INSERT INTO redirect_keys (content) VALUES (${hash})`;
await clipboardy.write(mnemonic);
storeSpinner.succeed();
console.log();
console.log(
c.green('√ '),
'Your passphrase has been stored, and is now ready to use when micro-link is deployed!',
'\n'
);
console.log(' ', c.green('Your passphrase is:'));
console.log(' ', c.bold(mnemonic));
console.log('\n ', c.green('It has also been copied to your clipboard.'));
process.exit(0);
}
if (isGit && hasIgnore) {
const pattern = /^\.intl\/?\s*$/gm;
if (!(await inGitIgnore(pattern))) {
const ignore = '.intl/';
const header = '# Intl generated schemas (https://intljs.com/docs/schemas)';
await addToGitIgnore(header, ignore);
};
}
const { language, phrase } = greeting();
const time = printDuration(Date.now() - startTime);
console.log(`\n ${bold(phrase)} ${dim(`(that's "Hello world!" in ${italic(language)})`)}
${green('✔')} Project initialized ${dim(time)}
${dim('Next steps:')}
${dim(terminalPrompt())} ${green('intl add ')}
${dim(terminalPrompt())} ${green(`cd ${srcDir}`)}
`)
}
console.log(blue('\n⏳ Building CSS themes...'))
for (const theme of fs.readdirSync('./build/themes')) {
const preparedThemeConfig = createRollupConfigWithoutPlugins(
`./build/themes/${theme}`,
)
const outputFile = `./themes/${theme.replace('.js', '.css')}`
const bundle = await rollup(
preparedThemeConfig(createPluginSCSS(outputFile)),
)
await bundle.write(getOutputConfigs.theme(theme))
fs.unlinkSync(`./themes/${theme}`)
}
console.log(green('✓ Themes\n'))
}
const color = (clr: string | undefined, message: string): string => {
switch (clr) {
case 'brightblue':
return blueBright(message);
case 'brightred':
return redBright(message);
case 'red':
return red(message);
case 'green':
return green(message);
case 'yellow':
return yellow(message);
default:
return message;
}
};
fileAction(color, type, fp) {
if (this.options.logLevel < 3) {
return
}
this.info(
`${colors[color](type)} ${colors.green(path.relative(process.cwd(), fp))}`
)
}
}).replace(/ --?([^\s,]+)/gi, (match) => {
return c.green(match);
});
};