File tree Expand file tree Collapse file tree 3 files changed +18
-20
lines changed
Expand file tree Collapse file tree 3 files changed +18
-20
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env node
22import './.env.js' ; // Workaround to ensure `SUPPRESS_NO_CONFIG_WARNING` is set before config is imported
33
4+ import fs from 'fs' ;
45import path from 'path' ;
56import { fileURLToPath , pathToFileURL } from 'url' ;
67
8+ import { program } from 'commander' ;
9+
710const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
811
9- import ( pathToFileURL ( path . resolve ( __dirname , '../src/main.js' ) ) ) ;
12+ const { description, version } = JSON . parse ( fs . readFileSync ( new URL ( '../package.json' , import . meta. url ) ) . toString ( ) ) ;
13+
14+ program
15+ . name ( 'ota-track' )
16+ . description ( description )
17+ . version ( version )
18+ . option ( '-s, --services [serviceId...]' , 'service IDs of services to handle' )
19+ . option ( '-d, --documentTypes [documentType...]' , 'terms types to handle' )
20+ . option ( '-r, --refilter-only' , 'only refilter exisiting snapshots with last declarations and engine\'s updates' )
21+ . option ( '--schedule' , 'schedule automatic document tracking' ) ;
22+
23+ const track = ( await import ( pathToFileURL ( path . resolve ( __dirname , '../src/index.js' ) ) ) ) . default ;
24+
25+ track ( program . parse ( process . argv ) . opts ( ) ) ;
Original file line number Diff line number Diff line change 4141 "lint" : " eslint src test scripts bin" ,
4242 "lint:fix" : " npm run lint -- --fix" ,
4343 "refilter" : " npm start -- --refilter-only" ,
44- "start" : " node --max-http-header-size=32768 src/main .js" ,
44+ "start" : " node --max-http-header-size=32768 bin/track .js" ,
4545 "start:scheduler" : " npm start -- --schedule" ,
4646 "test" : " cross-env NODE_ENV=test mocha --recursive \" ./src/**/*.test.js\" \" ./scripts/**/*.test.js\" --exit" ,
4747 "posttest" : " npm run lint" ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments