@@ -205,7 +205,7 @@ internal Dictionary<string, List<UnityPackageManagerRegistry>> UnityPackageManag
205
205
/// <summary>
206
206
/// Add a scoped registries.
207
207
/// </summary>
208
- /// <para name="registries">Registries to add to the manifest.</para>
208
+ /// <param name="registries">Registries to add to the manifest.</para>
209
209
/// <returns>true if the registries are added to the manifest, false otherwise.</returns>
210
210
internal bool AddRegistries ( IEnumerable < UnityPackageManagerRegistry > registries ) {
211
211
List < object > scopedRegistries ;
@@ -222,7 +222,7 @@ internal bool AddRegistries(IEnumerable<UnityPackageManagerRegistry> registries)
222
222
scopedRegistries = new List < object > ( ) ;
223
223
manifestDict [ MANIFEST_SCOPED_REGISTRIES_KEY ] = scopedRegistries ;
224
224
}
225
- RemoveRegistries ( registries ) ;
225
+ RemoveRegistries ( registries , displayWarning : false ) ;
226
226
foreach ( var registry in registries ) {
227
227
scopedRegistries . Add ( new Dictionary < string , object > ( ) {
228
228
{ MANIFEST_REGISTRY_NAME_KEY , registry . Name } ,
@@ -236,9 +236,12 @@ internal bool AddRegistries(IEnumerable<UnityPackageManagerRegistry> registries)
236
236
/// <summary>
237
237
/// Remove all scoped registries in the given list.
238
238
/// </summary>
239
- /// <para name="registries">A list of scoped registry to be removed</para>
239
+ /// <para, name="registries">A list of scoped registry to be removed</para>
240
+ /// <param name="displayWarning">Whether to display a warning if specified registries were not
241
+ /// found.</param>
240
242
/// <returns>true if the registries could be removed, false otherwise.</returns>
241
- internal bool RemoveRegistries ( IEnumerable < UnityPackageManagerRegistry > registries ) {
243
+ internal bool RemoveRegistries ( IEnumerable < UnityPackageManagerRegistry > registries ,
244
+ bool displayWarning = true ) {
242
245
List < object > scopedRegistries = null ;
243
246
try {
244
247
scopedRegistries = ScopedRegistries ;
@@ -268,9 +271,11 @@ internal bool RemoveRegistries(IEnumerable<UnityPackageManagerRegistry> registri
268
271
if ( remaining == 0 ) removed ++ ;
269
272
}
270
273
}
271
- Logger . Log ( String . Format ( "Removed {0}/{1} registries from '{2}'" ,
272
- removed , numberOfRegistries , MANIFEST_FILE_PATH ) ,
273
- level : removed == numberOfRegistries ? LogLevel . Verbose : LogLevel . Warning ) ;
274
+ if ( displayWarning ) {
275
+ Logger . Log ( String . Format ( "Removed {0}/{1} registries from '{2}'" ,
276
+ removed , numberOfRegistries , MANIFEST_FILE_PATH ) ,
277
+ level : removed == numberOfRegistries ? LogLevel . Verbose : LogLevel . Warning ) ;
278
+ }
274
279
return removed == numberOfRegistries ;
275
280
}
276
281
0 commit comments