choco icon indicating copy to clipboard operation
choco copied to clipboard

Make PackageName default to ChocolateyPackageName

Open FranklinYu opened this issue 6 years ago • 7 comments

Following helpers have a parameter -PackageName:

  • Install-ChocolateyZipPackage
  • Get-ChocolateyUnzip

When they are used in install scripts (which is likely to be the case), this parameter seems redundant since we already have $env:ChocolateyPackageName. It would be great to let it default to $env:ChocolateyPackageName when this environment variable is available.

FranklinYu avatar Jan 22 '19 17:01 FranklinYu

Sounds like a good idea. Have added this to up for grabs.

ferventcoder avatar Feb 03 '19 21:02 ferventcoder

I am a new contributor to this project and was wondering if I could be assigned this issue.

IronPenguin4179 avatar Mar 26 '19 21:03 IronPenguin4179

I'm going to look into this as a first issue. Please let me know if this is no longer relevant or desired.

cowmanjoe avatar Dec 29 '19 21:12 cowmanjoe

Would this change not also apply to Install-ChocolateyPackage as well?

cowmanjoe avatar Dec 30 '19 01:12 cowmanjoe

Would this change not also apply to Install-ChocolateyPackage as well?

Yes I think so! Thank you for your Pull Request.

FranklinYu avatar Jan 02 '20 04:01 FranklinYu

Added this default value for several other scripts that use $packageName. If this is an optional parameter now that it has a default variable, shouldn't it not be in position 0? The problem is if we change the position, it breaks the API for other calling scripts.

cowmanjoe avatar Jan 04 '20 23:01 cowmanjoe

The problem is if we change the position, it breaks the API for other calling scripts.

Yes, that would be a breaking change. Although it sounds nice to have optional parameters after all the required ones, it’s not worth it to break packages, especially corporate internal ones (we are able to update the community feed ourselves).

Note that we already have some of such “wrong parameters”, like -Url parameter of Install-ChocolateyZipPackage, for the same reason I guess.

FranklinYu avatar Jan 05 '20 04:01 FranklinYu