Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected async createConfig(flags: Flags) {
const service = flags.key ? getServiceFromKey(flags.key) : undefined;
const config = await loadConfig({
configPath: flags.config && parse(resolve(flags.config)).dir,
configFileName: flags.config,
name: service,
type: this.type
});
if (!config) {
this.error("A config failed to load, so the command couldn't be run");
this.exit(1);
return;
}
config.tag = flags.tag || config.tag || "current";
// flag overrides
config.setDefaults({
engine: {
async loadConfigFromFlags(flags: Record, service?: string) {
const config = await loadConfig({
configPath: flags.config && parse(resolve(flags.config)).dir,
configFileName: flags.config,
name: service,
type: this.type // how do we set this for client projects?
});
if (!config)
throw new Error(
"A config failed to load, so the command couldn't be run"
);
config.tag = flags.tag || config.tag || "current";
// flag overrides
config.setDefaults({
engine: {
apiKey: flags.key,