@@ -181,7 +181,9 @@ private static void MixinContent(Dictionary<string, object> fileContent, Config
181181 continue ;
182182 }
183183
184- if ( item . Key . StartsWith ( "prepend-" ) || item . Key . StartsWith ( "append-" ) )
184+ if ( item . Key . StartsWith ( "prepend-" )
185+ || item . Key . StartsWith ( "append-" )
186+ || item . Key . StartsWith ( "removed-" ) )
185187 {
186188 ModifyContentMerge ( fileContent , item . Key , item . Value ) ;
187189 }
@@ -207,6 +209,7 @@ private static void ModifyContent(Dictionary<string, object> fileContent, string
207209 private static void ModifyContentMerge ( Dictionary < string , object > fileContent , string key , object value )
208210 {
209211 bool blPrepend = false ;
212+ bool blRemoved = false ;
210213 if ( key . StartsWith ( "prepend-" ) )
211214 {
212215 blPrepend = true ;
@@ -217,16 +220,32 @@ private static void ModifyContentMerge(Dictionary<string, object> fileContent, s
217220 blPrepend = false ;
218221 key = key . Replace ( "append-" , "" ) ;
219222 }
223+ else if ( key . StartsWith ( "removed-" ) )
224+ {
225+ blRemoved = true ;
226+ key = key . Replace ( "removed-" , "" ) ;
227+ }
220228 else
221229 {
222230 return ;
223231 }
232+ var lstOri = ( List < object > ) fileContent [ key ] ;
233+ var lstValue = ( List < object > ) value ;
234+
235+ if ( blRemoved )
236+ {
237+ foreach ( var item in lstValue )
238+ {
239+ lstOri . RemoveAll ( t => t . ToString ( ) . StartsWith ( item . ToString ( ) ) ) ;
240+ }
241+ return ;
242+ }
243+
224244 if ( ! fileContent . ContainsKey ( key ) )
225245 {
246+ fileContent . Add ( key , value ) ;
226247 return ;
227248 }
228- var lstOri = ( List < object > ) fileContent [ key ] ;
229- var lstValue = ( List < object > ) value ;
230249
231250 if ( blPrepend )
232251 {
0 commit comments