Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tag: getDistTag(cliVersion) === 'canary' ? 'canary' : 'latest',
functions: config.functions,
...(projectSettings ? { projectSettings } : {}),
});
if (errors) {
this.output.error(errors[0].message);
await this.exit();
}
if (warnings && warnings.length > 0) {
warnings.forEach(warning => this.output.warn(warning.message));
}
if (builders) {
const { defaultRoutes, error: routesError } = await detectRoutes(
files,
builders
);
config.builds = config.builds || [];
config.builds.push(...builders);
if (routesError) {
this.output.error(routesError.message);
await this.exit();
} else {
config.routes = config.routes || [];
config.routes.push(...(defaultRoutes as RouteConfig[]));
}
}
}
const { builders, warnings, errors } = await detectBuilders(files, pkg, {
tag: getDistTag(cliVersion) === 'canary' ? 'canary' : 'latest',
});
if (errors) {
this.output.error(errors[0].message);
await this.exit();
}
if (warnings && warnings.length > 0) {
warnings.forEach(warning => this.output.warn(warning.message));
}
if (builders) {
const { defaultRoutes, error: routesError } = await detectRoutes(
files,
builders
);
config.builds = config.builds || [];
config.builds.push(...builders);
if (routesError) {
this.output.error(routesError.message);
await this.exit();
} else {
config.routes = config.routes || [];
config.routes.push(...(defaultRoutes as RouteConfig[]));
}
}
}
const files = allFiles.filter(this.filter);
this.output.debug(
`Found ${allFiles.length} and ` +
`filtered out ${allFiles.length - files.length} files`
);
const { builders, errors } = await detectBuilders(files, pkg);
if (errors) {
this.output.error(errors[0].message);
await this.exit();
}
if (builders) {
const { defaultRoutes, error: routesError } = await detectRoutes(
files,
builders
);
config.builds = config.builds || [];
config.builds.push(...builders);
if (routesError) {
this.output.error(routesError.message);
await this.exit();
} else {
config.routes = config.routes || [];
config.routes.push(...(defaultRoutes as RouteConfig[]));
}
}
}