d3ployer 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -195,12 +195,16 @@ const streamLogsTask = async (ctx) => {
195
195
  ...ctx.config.logs,
196
196
  };
197
197
  const time = logsConfig.time;
198
- const hasPm2 = ctx.config.pm2 !== false && await ctx.test('test -f pm2.config.*');
198
+ const hasPm2 = ctx.config.pm2 !== false
199
+ && await ctx.test('test -f pm2.config.*');
199
200
  const hasDocker = ctx.config.dockerCompose !== false
200
201
  && await ctx.test('test -f docker-compose.yml -o -f docker-compose.yaml -o -f compose.yml -o -f compose.yaml');
201
202
  if (hasPm2) {
203
+ const pm2ConfigRaw = await ctx.run('cat pm2.config.*', { printOutput: false });
204
+ const nameMatch = pm2ConfigRaw.stdout.match(/name: ['"](?<name>.+?)['"]/);
205
+ const name = nameMatch.groups?.name ?? 'all';
202
206
  console.log(chalk.cyan(`Streaming PM2 logs for ${time}s...`));
203
- await ctx.run(`timeout ${time} pm2 logs || true`, { printOutput: true, ignoreError: true });
207
+ await ctx.run(`timeout ${time} pm2 logs "${name}" || true`, { printOutput: true, ignoreError: true });
204
208
  }
205
209
  else if (hasDocker) {
206
210
  console.log(chalk.cyan(`Streaming Docker Compose logs for ${time}s...`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "d3ployer",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {