diff --git a/apps/cli/commands/site/status.ts b/apps/cli/commands/site/status.ts index 16ea40c2ba..38f91c03ec 100644 --- a/apps/cli/commands/site/status.ts +++ b/apps/cli/commands/site/status.ts @@ -88,7 +88,14 @@ export async function runCommand( siteFolder: string, format: 'table' | 'json' ) console.table( table.toString() ); } else { const logData = Object.fromEntries( - siteData.map( ( { jsonKey, value } ) => [ jsonKey, value ] ) + siteData.flatMap( ( { jsonKey, value } ) => + jsonKey === 'status' + ? [ + [ jsonKey, value ], + [ 'isOnline', isOnline ], + ] + : [ [ jsonKey, value ] ] + ) ); console.log( JSON.stringify( logData, null, 2 ) ); diff --git a/apps/cli/commands/site/tests/status.test.ts b/apps/cli/commands/site/tests/status.test.ts index 8351a6a8d5..a03cdbd88b 100644 --- a/apps/cli/commands/site/tests/status.test.ts +++ b/apps/cli/commands/site/tests/status.test.ts @@ -81,6 +81,7 @@ describe( 'CLI: studio site status', () => { siteUrl: 'http://localhost:8080/', sitePath: '/path/to/site', status: '🔴 Offline', + isOnline: false, phpVersion: '8.0', wpVersion: '6.4', xdebug: 'Disabled', @@ -114,6 +115,7 @@ describe( 'CLI: studio site status', () => { autoLoginUrl: 'http://localhost:8080/studio-auto-login?redirect_to=%2Fwp-admin%2F', sitePath: '/path/to/site', status: '🟢 Online', + isOnline: true, phpVersion: '8.0', wpVersion: '6.4', xdebug: 'Disabled', @@ -155,6 +157,7 @@ describe( 'CLI: studio site status', () => { siteUrl: 'http://localhost:8080/', sitePath: '/path/to/site', status: '🔴 Offline', + isOnline: false, wpVersion: '6.4', xdebug: 'Disabled', adminUsername: 'admin',