File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
packages/wrangler/src/pages Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,13 @@ export const pagesDeploymentListCommand = createCommand({
3333 choices : [ "production" , "preview" ] ,
3434 description : "Environment type to list deployments for" ,
3535 } ,
36+ json : {
37+ type : "boolean" ,
38+ description : "Return output as clean JSON" ,
39+ default : false ,
40+ } ,
3641 } ,
37- async handler ( { projectName, environment } ) {
42+ async handler ( { projectName, environment, json } ) {
3843 const config = getConfigCache < PagesConfigCache > (
3944 PAGES_CONFIG_CACHE_FILENAME
4045 ) ;
@@ -93,7 +98,11 @@ export const pagesDeploymentListCommand = createCommand({
9398 account_id : accountId ,
9499 } ) ;
95100
96- logger . table ( data ) ;
101+ if ( json ) {
102+ logger . log ( JSON . stringify ( data , null , 2 ) ) ;
103+ } else {
104+ logger . table ( data ) ;
105+ }
97106 metrics . sendMetricsEvent ( "list pages deployments" ) ;
98107 } ,
99108} ) ;
You can’t perform that action at this time.
0 commit comments