File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ const argv = require ( 'yargs' ) . command (
2
+ '* path stage prUrl' ,
3
+ 'update advancement PR in frontmatter' ,
4
+ ( yargs ) => {
5
+ return yargs
6
+ . positional ( 'path' , {
7
+ describe : 'file path of the RFC to update' ,
8
+ type : 'string' ,
9
+ } )
10
+ . positional ( 'stage' , {
11
+ describe : 'the stage for advancement' ,
12
+ type : 'string' ,
13
+ } )
14
+ . positional ( 'prUrl' , {
15
+ describe : 'the url of PR for advancement' ,
16
+ type : 'string' ,
17
+ } )
18
+ . demandOption ( [ 'path' , 'stage' , 'prUrl' ] ) ;
19
+ }
20
+ ) . argv ;
21
+
22
+ const { readFileSync, writeFileSync } = require ( 'fs' ) ;
23
+
24
+ const Updater = require ( './lib/frontmatter-updater' ) ;
25
+
26
+ let path = argv . path ;
27
+ let file = readFileSync ( path , 'utf8' ) ;
28
+ const updater = new Updater ( file ) ;
29
+ let output = updater . updateMetadata ( { prs : { [ argv . stage ] : argv . prUrl } } ) ;
30
+ writeFileSync ( path , output ) ;
You can’t perform that action at this time.
0 commit comments