Skip to content

Commit

Permalink
refactor: remove --root and --port flags from astro preview command
Browse files Browse the repository at this point in the history
This change allows Astro to resolve the configuration using the
astro.config.js with the eventcatalog.config.js and the cli options,
ensuring proper handling of the options.

See #1015 (comment)
  • Loading branch information
carlosallexandre committed Dec 14, 2024
1 parent 21584f3 commit 846ef38
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/eventcatalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,10 @@ program
});

const previewCatalog = ({ command }: { command: Command }) => {
/**
* TODO: get the port and outDir from the eventcatalog.config.js.
*/
execSync(
`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro preview --root ${dir} --port 3000 ${command.args.join(' ').trim()}`,
{
cwd: core,
stdio: 'inherit',
}
);
execSync(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro preview ${command.args.join(' ').trim()}`, {
cwd: core,
stdio: 'inherit',
});
};

program
Expand Down

0 comments on commit 846ef38

Please sign in to comment.