Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function _chooseBillingAccount(projectId, extensionName, accounts) {
const choices = _.map(accounts, "displayName");
choices.push("Add new billing account");
const question = {
name: "billing",
type: "list",
message: `The extension ${clc.underline(
extensionName
)} requires your project to be upgraded to the Blaze plan. You have access to the following billing accounts.
Please select the one that you would like to associate with this project:`,
choices: choices,
};
return prompt
.promptOnce(question)
.then((answer) => {
if (answer === "Add new billing account") {
const billingURL = `https://console.cloud.google.com/billing/linkedaccount?project=${projectId}`;
return _openBillingAccount(projectId, billingURL, true);
} else {
const billingAccount = _.find(accounts, ["displayName", answer]);
return cloudbilling.setBillingAccount(projectId, billingAccount.name);
}
app.listen(options.port, options.host, function (err, result) {
if (err) { throw err };
console.log(clc.erase.screen);
console.log(clc.red(banner));
console.log(clc.red('> > > > Galaxy of Covers dev server running at ' + clc.underline('http://' + options.host + ':' + options.port) + ' < < < <') + '\n');
});
};
links.forEach(function (cur) {
var href = cur.match(/href\=\"(.+?(?=\"))\"/);
var inner = cur.match(/\>(.+?(?=\<\/a))\<\/a/);
if (href && inner) {
finalStr = finalStr.replace(cur, cliColor.underline(href[1]));
}
});
}
links.forEach(function(cur){
let href = cur.match(/href\=\"(.+?(?=\"))\"/);
let inner = cur.match(/\>(.+?(?=\<\/a))\<\/a/);
if(href && inner){
finalStr = finalStr.replace(cur, cliColor.underline(href[1]));
}
});
}
return;
}
setup.config.emulators = setup.config.emulators || {};
for (const selected of selections.emulators) {
setup.config.emulators[selected] = setup.config.emulators[selected] || {};
const currentPort = setup.config.emulators[selected].port;
if (currentPort) {
utils.logBullet(`Port for ${selected} already configured: ${clc.cyan(currentPort)}`);
} else {
await prompt(setup.config.emulators[selected], [
{
type: "input",
name: "port",
message: `Which port do you want to use for the ${clc.underline(selected)} emulator?`,
default: Constants.getDefaultPort(selected as Emulators),
},
]);
}
}
if (selections.emulators.length) {
await prompt(selections, [
{
name: "download",
type: "confirm",
message: "Would you like to download the emulators now?",
default: false,
},
]);
}
module.exports = function(error) {
if (error.children && error.children.length) {
logger.error(clc.bold.red("Error:"), clc.underline(error.message) + ":");
error.children.forEach(function(child) {
var out = "- ";
if (child.name) {
out += clc.bold(child.name) + " ";
}
out += child.message;
logger.error(out);
});
} else {
if (error.original) {
logger.debug(error.original.stack);
}
logger.error();
logger.error(clc.bold.red("Error:"), error.message);
}
);
}).join("\n");
throw new FirebaseError(
"The following functions are found in your project but do not exist in your local source code:\n" +
deleteList +
"\n\nAborting because deletion cannot proceed in non-interactive mode. To fix, manually delete the functions by running:\n" +
clc.bold(deleteCommands)
);
} else if (!options.force) {
logger.info(
"\nThe following functions are found in your project but do not exist in your local source code:\n" +
deleteList +
"\n\nIf you are renaming a function or changing its region, it is recommended that you create the new " +
"function first before deleting the old one to prevent event loss. For more info, visit " +
clc.underline(
"https://firebase.google.com/docs/functions/manage-functions#modify" + "\n"
)
);
}
const next = options.force
? Promise.resolve(true)
: promptOnce({
type: "confirm",
name: "confirm",
default: false,
message:
"Would you like to proceed with deletion? Selecting no will continue the rest of the deployments.",
});
return next.then(function(proceed) {
teaser () {
const versions = [
'Node: ' + helpers.version.getNodeVersion(),
'CLI: ' + helpers.version.getCliVersion(),
'ORM: ' + helpers.version.getOrmVersion()
];
this.log();
this.log(clc.underline('Sequelize CLI [' + versions.join(', ') + ']'));
this.log();
},
[method](...args: any[]) {
let stack = new StackTracey()
let site = stack[1]
let stamp = dayjs().format(process.env.PRODUCTION ? 'dddd-MMM-DD-YYYY-hh:mm:ss:SSSa' : 'hh:mm:ss:SSS')
let colors = { log: 'blue', info: 'green', warn: 'yellow', error: 'red' }
let color = (colors[method] || 'magenta') as string
let square = clc[color + 'Bright']('█') as string
if (method == 'error') color = color + 'Bright';
let file = clc.bold(`${(site.fileName as string).slice(0, -3)}`) + ':' + site.line
let name = process.env.NAME ? `[${process.env.NAME}]` : ''
let instance = process.env.INSTANCE ? `[${process.env.INSTANCE}]` : ''
let output = clc.underline(`${square}[${file}]${instance}${name}${site.callee}[${clc.blackBright(stamp)}]`)
if (method == 'error' && args.length > 0) {
let error = 'ERROR'
let first = args[0]
if (util.isString(first) && first.indexOf('UN') == 0) error = first;
output = clc.bold.redBright(`████ ${error} ████\r\n`) + output
}
process.stdout.write(`\r\n${output}\r\n`)
_console[method].apply(console, args)
process.stdout.write(`\r\n`)
},
})