Skip to content

Commit 5e17233

Browse files
committed
clean up code and add comments
1 parent 2c85cc8 commit 5e17233

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/code/ContainerRegistryServerAPICalls.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
using System.Text;
2121
using System.Security.Cryptography;
2222
using System.Text.Json;
23-
using Microsoft.PowerShell.Commands;
2423

2524
namespace Microsoft.PowerShell.PSResourceGet
2625
{

src/code/PublishHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,6 @@ internal void PushResource(string Repository, string modulePrefix, bool SkipDepe
434434
}
435435
}
436436

437-
// TODO: do we not want to additionally publish to DesintationPath if NupkgPath is specified?
438437
}
439438

440439
string repositoryUri = repository.Uri.AbsoluteUri;
@@ -445,13 +444,15 @@ internal void PushResource(string Repository, string modulePrefix, bool SkipDepe
445444

446445
if (_isNupkgPathSpecified)
447446
{
447+
// copy the .nupkg to a temp path (outputNupkgDir field) as we don't want to tamper with the original, possibly signed, .nupkg file
448448
string copiedNupkgFilePath = CopyNupkgFileToTempPath(nupkgFilePath: Path, errRecord: out ErrorRecord copyErrRecord);
449449
if (copyErrRecord != null)
450450
{
451451
_cmdletPassedIn.WriteError(copyErrRecord);
452452
return;
453453
}
454454

455+
// get package info (name, version, metadata hashtable) from the copied .nupkg package and then populate appropriate fields (_pkgName, _pkgVersion, parsedMetadata)
455456
GetPackageInfoFromNupkg(nupkgFilePath: copiedNupkgFilePath, errRecord: out ErrorRecord pkgInfoErrRecord);
456457
if (pkgInfoErrRecord != null)
457458
{
@@ -463,7 +464,6 @@ internal void PushResource(string Repository, string modulePrefix, bool SkipDepe
463464
if (!containerRegistryServer.PushNupkgContainerRegistry(outputNupkgDir, _pkgName, modulePrefix, _pkgVersion, resourceType, parsedMetadata, dependencies, _isNupkgPathSpecified, Path, out ErrorRecord pushNupkgContainerRegistryError))
464465
{
465466
_cmdletPassedIn.WriteError(pushNupkgContainerRegistryError);
466-
// exit out of processing
467467
return;
468468
}
469469
}

0 commit comments

Comments
 (0)