Skip to content

Commit

Permalink
handle arrays of integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Jun 21, 2023
1 parent c7a0e4a commit 053c19d
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions packages/astro/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,7 @@ async function printInfo({
const whichPm = await import('which-pm');
const packageManager = await whichPm.default(process.cwd());
let adapter = "Couldn't determine.";
const integrations = [];

function isIntegration(integration: any): integration is AstroIntegration {
if (typeof integration === 'object') {
return true;
}
return false;
}
let integrations = [];

const MAX_PADDING = 25;
function printRow(label: string, value: string) {
Expand All @@ -112,11 +105,10 @@ async function printInfo({
adapter = userConfig.adapter.name;
}
if (userConfig.integrations) {
for (const integration of userConfig.integrations) {
if (isIntegration(integration)) {
integrations.push(integration.name);
}
}
integrations = (userConfig?.integrations ?? [])
.filter(Boolean)
.flat()
.map((i: any) => i?.name);
}
} catch (_e) {}
console.log();
Expand Down

0 comments on commit 053c19d

Please sign in to comment.