@@ -60,7 +60,7 @@ public ChocolateyService(IMapper mapper, IProgressService progressService, IChoc
60
60
_configService = configService ;
61
61
_choco = Lets . GetChocolatey ( initializeLogging : false ) . SetCustomLogging ( new SerilogLogger ( Logger , _progressService ) , logExistingMessages : false , addToExistingLoggers : true ) ;
62
62
63
- _localAppDataPath = _fileSystem . combine_paths ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData , Environment . SpecialFolderOption . DoNotVerify ) , "Chocolatey GUI" ) ;
63
+ _localAppDataPath = _fileSystem . CombinePaths ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData , Environment . SpecialFolderOption . DoNotVerify ) , "Chocolatey GUI" ) ;
64
64
}
65
65
66
66
public Task < bool > IsElevated ( )
@@ -73,7 +73,7 @@ public async Task<IEnumerable<Package>> GetInstalledPackages()
73
73
_choco . Set (
74
74
config =>
75
75
{
76
- config . CommandName = CommandNameType . list . ToString ( ) ;
76
+ config . CommandName = CommandNameType . List . ToString ( ) ;
77
77
} ) ;
78
78
79
79
var chocoConfig = _choco . GetConfiguration ( ) ;
@@ -91,7 +91,7 @@ public async Task<IEnumerable<Package>> GetInstalledPackages()
91
91
else
92
92
{
93
93
var nugetService = _choco . Container ( ) . GetInstance < INugetService > ( ) ;
94
- var packages = await Task . Run ( ( ) => nugetService . list_run ( chocoConfig ) ) ;
94
+ var packages = await Task . Run ( ( ) => nugetService . List ( chocoConfig ) ) ;
95
95
return packages
96
96
. Select ( package => GetMappedPackage ( _choco , package , _mapper , true ) )
97
97
. ToArray ( ) ;
@@ -107,7 +107,7 @@ public async Task<IReadOnlyList<OutdatedPackage>> GetOutdatedPackages(bool inclu
107
107
return new List < OutdatedPackage > ( ) ;
108
108
}
109
109
110
- var outdatedPackagesFile = _fileSystem . combine_paths ( _localAppDataPath , "outdatedPackages.xml" ) ;
110
+ var outdatedPackagesFile = _fileSystem . CombinePaths ( _localAppDataPath , "outdatedPackages.xml" ) ;
111
111
112
112
var outdatedPackagesCacheDurationInMinutesSetting = _configService . GetEffectiveConfiguration ( ) . OutdatedPackagesCacheDurationInMinutes ;
113
113
int outdatedPackagesCacheDurationInMinutes = 0 ;
@@ -116,9 +116,9 @@ public async Task<IReadOnlyList<OutdatedPackage>> GetOutdatedPackages(bool inclu
116
116
int . TryParse ( outdatedPackagesCacheDurationInMinutesSetting , out outdatedPackagesCacheDurationInMinutes ) ;
117
117
}
118
118
119
- if ( _fileSystem . file_exists ( outdatedPackagesFile ) && ( DateTime . Now - _fileSystem . get_file_modified_date ( outdatedPackagesFile ) ) . TotalMinutes < outdatedPackagesCacheDurationInMinutes )
119
+ if ( _fileSystem . FileExists ( outdatedPackagesFile ) && ( DateTime . Now - _fileSystem . GetFileModifiedDate ( outdatedPackagesFile ) ) . TotalMinutes < outdatedPackagesCacheDurationInMinutes )
120
120
{
121
- return _xmlService . deserialize < List < OutdatedPackage > > ( outdatedPackagesFile ) ;
121
+ return _xmlService . Deserialize < List < OutdatedPackage > > ( outdatedPackagesFile ) ;
122
122
}
123
123
else
124
124
{
@@ -140,7 +140,7 @@ public async Task<IReadOnlyList<OutdatedPackage>> GetOutdatedPackages(bool inclu
140
140
if ( chocoConfig . Sources != null )
141
141
{
142
142
var nugetService = choco . Container ( ) . GetInstance < INugetService > ( ) ;
143
- var packages = await Task . Run ( ( ) => nugetService . upgrade_noop ( chocoConfig , null ) ) ;
143
+ var packages = await Task . Run ( ( ) => nugetService . UpgradeDryRun ( chocoConfig , null ) ) ;
144
144
var results = packages
145
145
. Where ( p => ! p . Value . Inconclusive )
146
146
. Select ( p => new OutdatedPackage
@@ -154,12 +154,12 @@ public async Task<IReadOnlyList<OutdatedPackage>> GetOutdatedPackages(bool inclu
154
154
// packages, when the serialized file has become old/stale, so we NEED the file to be re-written
155
155
// when this check is done, so that it isn't always doing the check. Therefore, when we are
156
156
// getting ready to serialize the list of outdated packages, if the file already exists, delete it.
157
- if ( _fileSystem . file_exists ( outdatedPackagesFile ) )
157
+ if ( _fileSystem . FileExists ( outdatedPackagesFile ) )
158
158
{
159
- _fileSystem . delete_file ( outdatedPackagesFile ) ;
159
+ _fileSystem . DeleteFile ( outdatedPackagesFile ) ;
160
160
}
161
161
162
- _xmlService . serialize ( results , outdatedPackagesFile ) ;
162
+ _xmlService . Serialize ( results , outdatedPackagesFile ) ;
163
163
}
164
164
catch ( Exception ex )
165
165
{
@@ -189,7 +189,7 @@ public async Task<PackageOperationResult> InstallPackage(
189
189
choco . Set (
190
190
config =>
191
191
{
192
- config . CommandName = CommandNameType . install . ToString ( ) ;
192
+ config . CommandName = CommandNameType . Install . ToString ( ) ;
193
193
config . PackageNames = id ;
194
194
config . Features . UsePackageExitCodes = false ;
195
195
@@ -369,7 +369,7 @@ public async Task<PackageOperationResult> UninstallPackage(string id, string ver
369
369
choco . Set (
370
370
config =>
371
371
{
372
- config . CommandName = CommandNameType . uninstall . ToString ( ) ;
372
+ config . CommandName = CommandNameType . Uninstall . ToString ( ) ;
373
373
config . PackageNames = id ;
374
374
config . Features . UsePackageExitCodes = false ;
375
375
@@ -392,7 +392,7 @@ public async Task<PackageOperationResult> UpdatePackage(string id, Uri source =
392
392
choco . Set (
393
393
config =>
394
394
{
395
- config . CommandName = CommandNameType . upgrade . ToString ( ) ;
395
+ config . CommandName = CommandNameType . Upgrade . ToString ( ) ;
396
396
config . PackageNames = id ;
397
397
config . Features . UsePackageExitCodes = false ;
398
398
} ) ;
@@ -409,7 +409,7 @@ public async Task<PackageOperationResult> PinPackage(string id, string version)
409
409
config =>
410
410
{
411
411
config . CommandName = "pin" ;
412
- config . PinCommand . Command = PinCommandType . add ;
412
+ config . PinCommand . Command = PinCommandType . Add ;
413
413
config . PinCommand . Name = id ;
414
414
config . Version = version ;
415
415
config . Sources = ApplicationParameters . PackagesLocation ;
@@ -436,7 +436,7 @@ public async Task<PackageOperationResult> UnpinPackage(string id, string version
436
436
config =>
437
437
{
438
438
config . CommandName = "pin" ;
439
- config . PinCommand . Command = PinCommandType . remove ;
439
+ config . PinCommand . Command = PinCommandType . Remove ;
440
440
config . PinCommand . Name = id ;
441
441
config . Version = version ;
442
442
config . Sources = ApplicationParameters . PackagesLocation ;
@@ -474,7 +474,7 @@ public async Task SetFeature(ChocolateyFeature feature)
474
474
config =>
475
475
{
476
476
config . CommandName = "feature" ;
477
- config . FeatureCommand . Command = feature . Enabled ? chocolatey . infrastructure . app . domain . FeatureCommandType . enable : chocolatey . infrastructure . app . domain . FeatureCommandType . disable ;
477
+ config . FeatureCommand . Command = feature . Enabled ? chocolatey . infrastructure . app . domain . FeatureCommandType . Enable : chocolatey . infrastructure . app . domain . FeatureCommandType . Disable ;
478
478
config . FeatureCommand . Name = feature . Name ;
479
479
} ) ;
480
480
@@ -497,7 +497,7 @@ public async Task SetSetting(ChocolateySetting setting)
497
497
config =>
498
498
{
499
499
config . CommandName = "config" ;
500
- config . ConfigCommand . Command = chocolatey . infrastructure . app . domain . ConfigCommandType . set ;
500
+ config . ConfigCommand . Command = chocolatey . infrastructure . app . domain . ConfigCommandType . Set ;
501
501
config . ConfigCommand . Name = setting . Key ;
502
502
config . ConfigCommand . ConfigValue = setting . Value ;
503
503
} ) ;
@@ -514,7 +514,7 @@ public async Task<ChocolateySource[]> GetSources()
514
514
var config = await GetConfigFile ( ) ;
515
515
var allSources = config . Sources . Select ( _mapper . Map < ChocolateySource > ) . ToArray ( ) ;
516
516
517
- var filteredSourceIds = _configSettingsService . source_list ( _choco . GetConfiguration ( ) ) . Select ( s => s . Id ) . ToArray ( ) ;
517
+ var filteredSourceIds = _configSettingsService . ListSources ( _choco . GetConfiguration ( ) ) . Select ( s => s . Id ) . ToArray ( ) ;
518
518
519
519
var mappedSources = allSources . Where ( s => filteredSourceIds . Contains ( s . Id ) ) . ToArray ( ) ;
520
520
return mappedSources ;
@@ -528,7 +528,7 @@ public async Task AddSource(ChocolateySource source)
528
528
config =>
529
529
{
530
530
config . CommandName = "source" ;
531
- config . SourceCommand . Command = SourceCommandType . add ;
531
+ config . SourceCommand . Command = SourceCommandType . Add ;
532
532
config . SourceCommand . Name = source . Id ;
533
533
config . Sources = source . Value ;
534
534
config . SourceCommand . Username = source . UserName ;
@@ -560,7 +560,7 @@ public async Task DisableSource(string id)
560
560
config =>
561
561
{
562
562
config . CommandName = "source" ;
563
- config . SourceCommand . Command = SourceCommandType . disable ;
563
+ config . SourceCommand . Command = SourceCommandType . Disable ;
564
564
config . SourceCommand . Name = id ;
565
565
} ) ;
566
566
@@ -573,7 +573,7 @@ public async Task EnableSource(string id)
573
573
config =>
574
574
{
575
575
config . CommandName = "source" ;
576
- config . SourceCommand . Command = SourceCommandType . enable ;
576
+ config . SourceCommand . Command = SourceCommandType . Enable ;
577
577
config . SourceCommand . Name = id ;
578
578
} ) ;
579
579
@@ -611,7 +611,7 @@ public async Task<bool> RemoveSource(string id)
611
611
config =>
612
612
{
613
613
config . CommandName = "source" ;
614
- config . SourceCommand . Command = SourceCommandType . remove ;
614
+ config . SourceCommand . Command = SourceCommandType . Remove ;
615
615
config . SourceCommand . Name = id ;
616
616
} ) ;
617
617
@@ -646,7 +646,7 @@ private static Package GetMappedPackage(GetChocolatey choco, PackageResult packa
646
646
}
647
647
648
648
var packageInfoService = choco . Container ( ) . GetInstance < IChocolateyPackageInformationService > ( ) ;
649
- var packageInfo = packageInfoService . get_package_information ( package . PackageMetadata ) ;
649
+ var packageInfo = packageInfoService . Get ( package . PackageMetadata ) ;
650
650
mappedPackage . IsPinned = packageInfo . IsPinned ;
651
651
mappedPackage . IsInstalled = ! string . IsNullOrWhiteSpace ( package . InstallLocation ) || forceInstalled ;
652
652
@@ -714,7 +714,7 @@ private async Task<ConfigFileSettings> GetConfigFile()
714
714
var xmlService = _choco . Container ( ) . GetInstance < IXmlService > ( ) ;
715
715
var config =
716
716
await Task . Run (
717
- ( ) => xmlService . deserialize < ConfigFileSettings > ( chocolatey . infrastructure . app . ApplicationParameters . GlobalConfigFileLocation ) ) ;
717
+ ( ) => xmlService . Deserialize < ConfigFileSettings > ( chocolatey . infrastructure . app . ApplicationParameters . GlobalConfigFileLocation ) ) ;
718
718
return config ;
719
719
}
720
720
}
0 commit comments