File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,18 @@ function log(message: string) {
1515export async function run ( name : string , ...steps : Step [ ] ) {
1616 const { execSync } = await import ( 'child_process' ) ;
1717
18+ const runOne = process . argv [ 2 ] ;
19+ if ( runOne ) {
20+ const match = steps . find ( ( s ) => `${ name } /${ s . name } ` === runOne ) ;
21+ if ( ! match ) {
22+ console . error ( `x No step found with name "${ runOne } "` ) ;
23+ process . exit ( 1 ) ;
24+ }
25+
26+ steps = [ match ] ;
27+ }
28+
29+ const start = process . hrtime ( ) ;
1830 for ( const step of steps ) {
1931 if ( ! step . condition ( ) ) {
2032 log ( `- Skipping step "${ name } /${ step . name } "...` ) ;
@@ -29,4 +41,9 @@ export async function run(name: string, ...steps: Step[]) {
2941 process . exit ( 1 ) ;
3042 }
3143 }
44+
45+ const diff = process . hrtime ( start ) ;
46+ const time = diff [ 0 ] * 1e9 + diff [ 1 ] ;
47+ const timeStr = time > 1e9 ? `${ ( time / 1e9 ) . toFixed ( 2 ) } s` : `${ ( time / 1e6 ) . toFixed ( 2 ) } ms` ;
48+ log ( `✓ Steps in "${ name } " completed in ${ timeStr } .` ) ;
3249}
You can’t perform that action at this time.
0 commit comments