Skip to content

Commit d8c56d3

Browse files
committed
fix: always include .port() for backend, add .build(), add pkgManager to generated config
1 parent 3d84ca0 commit d8c56d3

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/cli/commands/init.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ function generateConfig(opts: ConfigOptions): string {
273273
lines.push(` .pm2('${opts.pm2Name}')`);
274274
}
275275

276-
if (opts.backendPort && opts.backendPort !== 3000) {
277-
lines.push(` .port(${opts.backendPort})`);
276+
if (opts.app === 'backend') {
277+
lines.push(` .port(${opts.backendPort ?? 3000})`);
278278
}
279279

280280
if (opts.domain) {
@@ -285,12 +285,15 @@ function generateConfig(opts: ConfigOptions): string {
285285
lines.push(' .zeroDowntime()');
286286
}
287287

288-
if (opts.healthCheckPath && opts.healthCheckPath !== '/health') {
289-
lines.push(` .healthCheck('${opts.healthCheckPath}')`);
290-
} else if (opts.healthCheckPath) {
288+
if (opts.healthCheckPath) {
291289
lines.push(` .healthCheck('${opts.healthCheckPath}')`);
292290
}
293291

292+
if (opts.pkgManager) {
293+
lines.push(` .pkgManager('${opts.pkgManager}')`);
294+
}
295+
296+
lines.push(' .build();');
294297
lines.push('');
295298
return lines.join('\n');
296299
}

0 commit comments

Comments
 (0)