Skip to content

Commit

Permalink
fix(node): Add default outputPath if not provided.
Browse files Browse the repository at this point in the history
  • Loading branch information
ndcunningham committed Jun 27, 2024
1 parent a7df67d commit 61b3d28
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/node/src/generators/setup-docker/setup-docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,22 @@ function normalizeOptions(

function addDocker(tree: Tree, options: SetUpDockerOptions) {
const projectConfig = readProjectConfiguration(tree, options.project);

const outputPath =
projectConfig.targets[options.buildTarget]?.options['outputPath'];

if (!projectConfig) {
throw new Error(`Cannot find project configuration for ${options.project}`);
}

if (!outputPath && !options.outputPath) {
throw new Error(
`The output path for the project ${options.project} is not defined. Please provide it as an option to the generator.`
);
}
generateFiles(tree, join(__dirname, './files'), projectConfig.root, {
tmpl: '',
buildLocation: options.outputPath,
buildLocation: options.outputPath ?? outputPath,
project: options.project,
});
}
Expand Down

0 comments on commit 61b3d28

Please sign in to comment.