Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Munkkeli authored Dec 19, 2024
1 parent 2c4bd7f commit 58f0999
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@ try {
);
}

const isDevImageAvailable = fs.existsSync(path.join(component.identifier, 'Dockerfile.dev'));

const componentOutput = {
identifier: component.identifier,
name: component.name || component.identifier,
folder: component.identifier,
prefix: isDevImageAvailable ? '.dev' : undefined,
ref: component.package.split('#').pop(),
};

componentsOutput.push(componentOutput);

if (fs.existsSync(path.join(component.identifier, 'Dockerfile.dev'))) {
if (isDevImageAvailable) {
componentsOutput.push({
...componentOutput,
stage: 'dev',
dockerfile: 'Dockerfile.dev',
prefix: '.dev',
});
}
}
Expand Down

0 comments on commit 58f0999

Please sign in to comment.