@@ -11,15 +11,15 @@ public class InstallPkgParams
1111 public string Name { get ; set ; }
1212 public VersionRange Version { get ; set ; }
1313 public string Repository { get ; set ; }
14- public bool AcceptLicense { get ; set ; }
14+ public bool ? AcceptLicense { get ; set ; }
1515 public bool Prerelease { get ; set ; }
16- public ScopeType Scope { get ; set ; }
17- public bool Quiet { get ; set ; }
18- public bool Reinstall { get ; set ; }
16+ public ScopeType ? Scope { get ; set ; }
17+ public bool ? Quiet { get ; set ; }
18+ public bool ? Reinstall { get ; set ; }
1919 public bool Force { get ; set ; }
20- public bool TrustRepository { get ; set ; }
21- public bool NoClobber { get ; set ; }
22- public bool SkipDependencyCheck { get ; set ; }
20+ public bool ? TrustRepository { get ; set ; }
21+ public bool ? NoClobber { get ; set ; }
22+ public bool ? SkipDependencyCheck { get ; set ; }
2323
2424
2525
@@ -67,8 +67,10 @@ public void SetProperty(string propertyName, string propertyValue, out ErrorReco
6767 break ;
6868
6969 case "acceptlicense" :
70- bool . TryParse ( propertyValue , out bool acceptLicenseTmp ) ;
71- AcceptLicense = acceptLicenseTmp ;
70+ if ( ! string . IsNullOrWhiteSpace ( propertyValue ) && bool . TryParse ( propertyValue , out bool acceptLicenseTmp ) )
71+ {
72+ AcceptLicense = acceptLicenseTmp ;
73+ }
7274 break ;
7375
7476 case "prerelease" :
@@ -82,28 +84,38 @@ public void SetProperty(string propertyName, string propertyValue, out ErrorReco
8284 break ;
8385
8486 case "quiet" :
85- bool . TryParse ( propertyValue , out bool quietTmp ) ;
86- Quiet = quietTmp ;
87+ if ( ! string . IsNullOrWhiteSpace ( propertyValue ) && bool . TryParse ( propertyValue , out bool quietTmp ) )
88+ {
89+ Quiet = quietTmp ;
90+ }
8791 break ;
8892
8993 case "reinstall" :
90- bool . TryParse ( propertyValue , out bool reinstallTmp ) ;
91- Reinstall = reinstallTmp ;
94+ if ( ! string . IsNullOrWhiteSpace ( propertyValue ) && bool . TryParse ( propertyValue , out bool reinstallTmp ) )
95+ {
96+ Reinstall = reinstallTmp ;
97+ }
9298 break ;
9399
94100 case "trustrepository" :
95- bool . TryParse ( propertyValue , out bool trustRepositoryTmp ) ;
96- TrustRepository = trustRepositoryTmp ;
101+ if ( ! string . IsNullOrWhiteSpace ( propertyValue ) && bool . TryParse ( propertyValue , out bool trustRepositoryTmp ) )
102+ {
103+ TrustRepository = trustRepositoryTmp ;
104+ }
97105 break ;
98106
99107 case "noclobber" :
100- bool . TryParse ( propertyValue , out bool noClobberTmp ) ;
101- NoClobber = noClobberTmp ;
108+ if ( ! string . IsNullOrWhiteSpace ( propertyValue ) && bool . TryParse ( propertyValue , out bool noClobberTmp ) )
109+ {
110+ NoClobber = noClobberTmp ;
111+ }
102112 break ;
103113
104114 case "skipdependencycheck" :
105- bool . TryParse ( propertyValue , out bool skipDependencyCheckTmp ) ;
106- SkipDependencyCheck = skipDependencyCheckTmp ;
115+ if ( ! string . IsNullOrWhiteSpace ( propertyValue ) && bool . TryParse ( propertyValue , out bool skipDependencyCheckTmp ) )
116+ {
117+ SkipDependencyCheck = skipDependencyCheckTmp ;
118+ }
107119 break ;
108120
109121 default :
0 commit comments