File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
packages/contentstack-branches Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @contentstack/cli-cm-branches" ,
33 "description" : " Contentstack CLI plugin to do branches operations" ,
4- "version" : " 1.3.0 " ,
4+ "version" : " 1.3.1 " ,
55 "author" : " Contentstack" ,
66 "bugs" : " https://github.com/contentstack/cli/issues" ,
77 "dependencies" : {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import os from 'os';
22import path from 'path' ;
33import forEach from 'lodash/forEach' ;
44import { cliux } from '@contentstack/cli-utilities' ;
5+ import chalk from 'chalk' ;
56import { MergeInputOptions , MergeSummary } from '../interfaces' ;
67import {
78 selectMergeStrategy ,
@@ -132,8 +133,11 @@ export default class MergeHandler {
132133 } else if ( this . strategy === 'overwrite_with_compare' ) {
133134 this . mergeSettings . strategy = 'overwrite_with_compare' ;
134135 }
135-
136- await this . displayMergeSummary ( ) ;
136+ if ( this . checkEmptySelection ( ) ) {
137+ cliux . print ( chalk . red ( 'No items selected' ) ) ;
138+ } else {
139+ await this . displayMergeSummary ( ) ;
140+ }
137141
138142 if ( ! this . executeOption ) {
139143 const executionResponse = await selectMergeExecution ( ) ;
@@ -152,6 +156,17 @@ export default class MergeHandler {
152156 }
153157 }
154158
159+ checkEmptySelection ( ) {
160+ for ( let module in this . branchCompareData ) {
161+ if ( this . mergeSettings . mergeContent [ module ] ?. modified ?. length
162+ || this . mergeSettings . mergeContent [ module ] ?. added ?. length
163+ || this . mergeSettings . mergeContent [ module ] ?. deleted ?. length ) {
164+ return false ;
165+ }
166+ }
167+ return true ;
168+ }
169+
155170 displayMergeSummary ( ) {
156171 if ( this . mergeSettings . strategy !== 'ignore' ) {
157172 for ( let module in this . branchCompareData ) {
You can’t perform that action at this time.
0 commit comments