@@ -2330,36 +2330,34 @@ exports.runCommand = command_1.createCommand((api) => {
23302330 demandOption : true ,
23312331 } ) ;
23322332 } ,
2333- handler ( args ) {
2333+ async handler ( args ) {
23342334 var _a ;
2335- return tslib_1 . __awaiter ( this , void 0 , void 0 , function * ( ) {
2336- const commandName = args . command ;
2337- const command = ( _a = config === null || config === void 0 ? void 0 : config . commands ) === null || _a === void 0 ? void 0 : _a [ commandName ] ;
2338- if ( ! command ) {
2339- // Better error - example config
2340- throw new Error ( `Command ${ commandName } not found. Define it in bob.config.js` ) ;
2341- }
2342- const { affected, packages } = getAffectedPackages ( {
2343- config,
2344- filterCommand : commandName ,
2345- } ) ;
2346- if ( ! affected . length ) {
2347- reporter . success ( "Nothing is affected" ) ;
2348- return ;
2349- }
2350- reporter . info ( [
2351- `Affected packages: ` ,
2352- affected . map ( ( name ) => ` - ${ name } ` ) . join ( "\n" ) ,
2353- "\n\n" ,
2354- ] . join ( "\n" ) ) ;
2355- const input = {
2356- names : affected ,
2357- paths : affected . map ( ( name ) => packages [ name ] . location ) ,
2358- } ;
2359- const [ bin , rest ] = yield command . run ( input ) ;
2360- yield util_1 . promisify ( cross_spawn_1 . default ) ( bin , rest , {
2361- stdio : "inherit" ,
2362- } ) ;
2335+ const commandName = args . command ;
2336+ const command = ( _a = config === null || config === void 0 ? void 0 : config . commands ) === null || _a === void 0 ? void 0 : _a [ commandName ] ;
2337+ if ( ! command ) {
2338+ // Better error - example config
2339+ throw new Error ( `Command ${ commandName } not found. Define it in bob.config.js` ) ;
2340+ }
2341+ const { affected, packages } = getAffectedPackages ( {
2342+ config,
2343+ filterCommand : commandName ,
2344+ } ) ;
2345+ if ( ! affected . length ) {
2346+ reporter . success ( "Nothing is affected" ) ;
2347+ return ;
2348+ }
2349+ reporter . info ( [
2350+ `Affected packages: ` ,
2351+ affected . map ( ( name ) => ` - ${ name } ` ) . join ( "\n" ) ,
2352+ "\n\n" ,
2353+ ] . join ( "\n" ) ) ;
2354+ const input = {
2355+ names : affected ,
2356+ paths : affected . map ( ( name ) => packages [ name ] . location ) ,
2357+ } ;
2358+ const [ bin , rest ] = await command . run ( input ) ;
2359+ await util_1 . promisify ( cross_spawn_1 . default ) ( bin , rest , {
2360+ stdio : "inherit" ,
23632361 } ) ;
23642362 } ,
23652363 } ;
@@ -2781,35 +2779,33 @@ const tslib_1 = __webpack_require__(422);
27812779const core = tslib_1 . __importStar ( __webpack_require__ ( 470 ) ) ;
27822780const path_1 = __webpack_require__ ( 622 ) ;
27832781const run_1 = __webpack_require__ ( 776 ) ;
2784- function run ( ) {
2785- return tslib_1 . __awaiter ( this , void 0 , void 0 , function * ( ) {
2786- try {
2787- core . info ( "Running Bob..." ) ;
2788- core . info ( "Looking for bob.config.js" ) ;
2789- const config = require ( path_1 . resolve ( process . env . GITHUB_WORKSPACE , "bob.config.js" ) ) ;
2790- const filterCommand = core . getInput ( "command" ) ;
2791- if ( filterCommand ) {
2792- core . info ( `Scoping to one command: ${ filterCommand } ` ) ;
2793- }
2794- core . info ( "Checking affected packages" ) ;
2795- const { affected } = run_1 . getAffectedPackages ( {
2796- config,
2797- filterCommand,
2798- } ) ;
2799- affected . forEach ( ( name ) => {
2800- core . info ( `- ${ name } ` ) ;
2801- } ) ;
2802- if ( affected . length === 0 ) {
2803- core . info ( "No affected packages" ) ;
2804- }
2805- core . setOutput ( "dirty" , affected . length > 0 ? "true" : "false" ) ;
2782+ async function run ( ) {
2783+ try {
2784+ core . info ( "Running Bob..." ) ;
2785+ core . info ( "Looking for bob.config.js" ) ;
2786+ const config = require ( path_1 . resolve ( process . env . GITHUB_WORKSPACE , "bob.config.js" ) ) ;
2787+ const filterCommand = core . getInput ( "command" ) ;
2788+ if ( filterCommand ) {
2789+ core . info ( `Scoping to one command: ${ filterCommand } ` ) ;
28062790 }
2807- catch ( error ) {
2808- console . error ( error ) ;
2809- core . setFailed ( error . message ) ;
2810- core . setOutput ( "dirty" , "true" ) ;
2791+ core . info ( "Checking affected packages" ) ;
2792+ const { affected } = run_1 . getAffectedPackages ( {
2793+ config,
2794+ filterCommand,
2795+ } ) ;
2796+ affected . forEach ( ( name ) => {
2797+ core . info ( `- ${ name } ` ) ;
2798+ } ) ;
2799+ if ( affected . length === 0 ) {
2800+ core . info ( "No affected packages" ) ;
28112801 }
2812- } ) ;
2802+ core . setOutput ( "dirty" , affected . length > 0 ? "true" : "false" ) ;
2803+ }
2804+ catch ( error ) {
2805+ console . error ( error ) ;
2806+ core . setFailed ( error . message ) ;
2807+ core . setOutput ( "dirty" , "true" ) ;
2808+ }
28132809}
28142810run ( ) ;
28152811
0 commit comments