Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const titling = mode => stripIndent(colorReplacer)`
${`title|${metadata.name}`}${`dim| │ v${metadata.version()}`}
Mode: ${mode}
`
switch (argv.verbose) {
function prettyPrintBuilds(build: BuildResource): string {
let status = chalk.reset.yellow(build.status);
if (build.status === 'completed') {
status = chalk.reset.green(`${logSymbols.success} ${build.status}`);
} else if (build.status === 'failed') {
status = chalk.reset.red(`${logSymbols.error} ${build.status}`);
}
return stripIndent(chalk`
{bold ${build.sid}} {dim [${status}]}
{dim │} {cyan Date:} {dim ${formatDate(build.date_updated)}}
`);
}
styles.forEach(({ absoluteFilePath, value }) => {
outputFileSync(absoluteFilePath, stripIndent([value]));
});
}
.map(({ msg, rawError }, i) => {
const source: string | Source | undefined = (err.errors[i] as any).source;
msg = msg ? chalk.gray(indentString(stripIndent(`${msg}`), 4)) : null;
const stack = rawError.stack ? chalk.gray(indentString(stripIndent(rawError.stack), 4)) : null;
if (source) {
const sourceOfError = typeof source === 'string' ? source : source.name;
const title = indentString(`${logSymbol.error} ${sourceOfError}`, 2);
return [title, msg, stack, stack].filter(Boolean).join('\n');
}
return [msg, stack].filter(Boolean).join('\n');
})
.join('\n\n');
isInsideComment = getIsInsideComment(isInsideComment, value.raw);
const node = expressions[i];
if (node) {
if (isInsideComment) {
code += `\${${
t.isIdentifier(node) ? node.name : 'someVar'
}}`;
} else {
const index = getIndex(node, i);
code += `var(${getCSSVarName(index)})`;
}
}
});
code = stripIndent(code);
const append = t.taggedTemplateExpression(
t.identifier(addImport('css')),
t.templateLiteral(
[
t.templateElement({
raw: code,
cooked: code,
}),
],
[],
),
);
return append;
};
function printListResultTerminal(result: ListResult, config: ListConfig): void {
const sections = Object.keys(result) as ListOptions[];
const output = sections
.map(section => prettyPrintSection(section, result[section]))
.join(`\n\n${chalk.dim(LONG_LINE)}\n\n`);
let metaInfo = stripIndent(chalk`
{cyan.bold Account} ${config.accountSid}
{cyan.bold Token} ${redactPartOfString(config.authToken)}
`);
if (config.serviceSid || config.serviceName) {
metaInfo += chalk`\n{cyan.bold Service} ${config.serviceSid ||
config.serviceName}`;
}
if (config.environment) {
metaInfo += chalk`\n{cyan.bold Environment} ${config.environment}`;
}
logger.info(metaInfo + '\n');
writeOutput(output);
}
const CodeBlock = mapProps(({ mode, codeText, ...props }) => ({
...props,
dangerouslySetInnerHTML: {
__html:
mode === null ? codeText : prism(stripIndent([codeText]), mode || 'jsx'),
},
}))(
styled('pre')`
export function printActivateResult(result: ActivateResult) {
logger.info(chalk.cyan.bold('\nActive build available at:'));
writeOutput(result.domain);
const twilioConsoleLogsLink = terminalLink(
'Open the Twilio Console',
getTwilioConsoleDeploymentUrl(result.serviceSid, result.environmentSid),
{
fallback: (text: string, url: string) => chalk.dim(url),
}
);
logger.info(
'\n' +
stripIndent(chalk`
{cyan.bold View Live Logs:}
${twilioConsoleLogsLink}
`)
);
}
This will work, but it's not recommended.
If you are trying to pass multiple arguments, separate them with commas instead:
cypress run --${flag} arg1,arg2,arg3
`
if (flag === 'spec') {
msg += `
The most common cause of this warning is using an unescaped glob pattern. If you are
trying to pass a glob pattern, escape it using quotes:
cypress run --spec "**/*.spec.js"
`
}
logger.log()
logger.warn(stripIndent(msg))
logger.log()
}