@lde/pipeline-console-reporter 0.15.0 → 0.15.2

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.
@@ -96,21 +96,20 @@ export class ConsoleReporter {
96
96
  }
97
97
  else {
98
98
  const url = distribution.accessUrl.toString();
99
- const index = this.probeLines.findIndex((line) => line.url === url);
100
- if (index !== -1 && this.probeLines[index].text) {
101
- const linesUp = this.probeLines.length - index;
102
- const probe = this.probeLines[index];
99
+ const probe = this.probeLines.find((line) => line.url === url);
100
+ const text = probe?.text || url;
101
+ if (probe?.text && process.stderr.isTTY) {
102
+ const linesUp = this.probeLines.length - this.probeLines.indexOf(probe);
103
103
  // Move cursor up to the probe line and clear it.
104
104
  process.stderr.write(`\x1B[${linesUp}A\x1B[2K\r`);
105
- // Rewrite the probe line with "(selected)" appended.
106
- ora({ discardStdin: false }).succeed(`${probe.text} ${chalk.green('(selected)')}`);
105
+ ora({ discardStdin: false }).succeed(`${text} ${chalk.green('(selected)')}`);
107
106
  // Move cursor back down to original position.
108
107
  if (linesUp > 1) {
109
108
  process.stderr.write(`\x1B[${linesUp - 1}B`);
110
109
  }
111
110
  }
112
111
  else {
113
- ora({ discardStdin: false }).succeed(`${url} ${chalk.green('(selected)')}`);
112
+ ora({ discardStdin: false }).succeed(`${text} ${chalk.green('(selected)')}`);
114
113
  }
115
114
  }
116
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lde/pipeline-console-reporter",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "description": "Console progress reporter for @lde/pipeline",
5
5
  "repository": {
6
6
  "url": "git+https://github.com/ldelements/lde.git",
@@ -31,6 +31,6 @@
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@lde/dataset": "0.7.1",
34
- "@lde/pipeline": "0.24.0"
34
+ "@lde/pipeline": "0.24.1"
35
35
  }
36
36
  }