Skip to content

Commit 490362f

Browse files
authored
chore(ncu-ci)!: remove --copy flag (#1140)
Removes the dependency on `clipboardy`. Instead, pass the `--markdown` flag and pipe the result to e.g. `pbcopy`
1 parent 74bac7f commit 490362f

4 files changed

Lines changed: 10 additions & 276 deletions

File tree

bin/ncu-ci.js

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env node
22

33
import yargs from 'yargs';
4-
import clipboardy from 'clipboardy';
54

65
import {
76
JobParser,
@@ -222,11 +221,6 @@ const args = yargs(hideBin(process.argv))
222221
handler
223222
})
224223
.demandCommand(1, 'must provide a valid command')
225-
.option('copy', {
226-
describe: 'Write the results as markdown to clipboard',
227-
default: false,
228-
type: 'boolean'
229-
})
230224
.option('skip-more-than', {
231225
describe: 'Skip jobs that fail more than <limit> builds, when --stat is true, default to 10.',
232226
type: 'number',
@@ -397,7 +391,7 @@ class CICommand {
397391
this.json = this.json.concat(json);
398392
}
399393

400-
if ((argv.copy || argv.markdown) && !argv.stats) {
394+
if (argv.markdown && !argv.stats) {
401395
this.markdown += build.formatAsMarkdown();
402396
}
403397
}
@@ -408,16 +402,6 @@ class CICommand {
408402
async serialize() {
409403
const { argv, cli } = this;
410404

411-
if (argv.copy) {
412-
if (this.markdown) {
413-
clipboardy.writeSync(this.markdown);
414-
cli.separator('');
415-
cli.log('Written markdown to clipboard');
416-
} else {
417-
cli.error('No markdown generated');
418-
}
419-
}
420-
421405
if (argv.markdown) {
422406
if (this.markdown) {
423407
writeFile(argv.markdown, this.markdown);
@@ -483,7 +467,7 @@ class WalkCommand extends CICommand {
483467
cli.log('');
484468
aggregator.display();
485469

486-
if (argv.markdown || argv.copy) {
470+
if (argv.markdown) {
487471
this.markdown = aggregator.formatAsMarkdown();
488472
}
489473
}
@@ -564,7 +548,7 @@ class DailyCommand extends CICommand {
564548
cli.log('');
565549
aggregator.display();
566550

567-
if (argv.markdown || argv.copy) {
551+
if (argv.markdown) {
568552
this.markdown = aggregator.formatAsMarkdown();
569553
}
570554
}

docs/ncu-ci.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ Commands:
2727
2828
Options:
2929
--version Show version number [boolean]
30-
--copy Write the results as markdown to clipboard
31-
[boolean] [default: false]
3230
--nobuild If running cigtm, whether or not jobid is citgm-nobuild.
3331
[boolean] [default: false]
3432
--json <path> Write the results as json to <path> [string]

0 commit comments

Comments
 (0)