Skip to content

Commit

Permalink
refactor: inline adapter config log
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Jul 8, 2022
1 parent 4125d77 commit 6826650
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/astro/src/core/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ export default async function add(names: string[], { cwd, flags, logging, teleme
if (officialExportName) {
await setAdapter(ast, integration, officialExportName);
} else {
logAdapterConfigInstructions(integration, logging);
info(
logging,
null,
`\n ${magenta(`Check our deployment docs for ${bold(integration.packageName)} to update your "adapter" config.`)}`
);
}
} else {
await addIntegration(ast, integration);
Expand Down Expand Up @@ -264,14 +268,6 @@ function isAdapter(integration: IntegrationInfo): integration is IntegrationInfo
return integration.type === 'adapter';
}

function logAdapterConfigInstructions(adapter: (IntegrationInfo & { type: 'adapter' }), logging: LogOptions) {
info(
logging,
null,
`\n ${magenta(`Check our deployment docs for ${bold(adapter.packageName)} to update your "adapter" config.`)}`
);
}

async function parseAstroConfig(configURL: URL): Promise<t.File> {
const source = await fs.readFile(fileURLToPath(configURL), { encoding: 'utf-8' });
const result = parse(source);
Expand Down

0 comments on commit 6826650

Please sign in to comment.