Skip to content

Make PackageName default to ChocolateyPackageName #1716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
FranklinYu opened this issue Jan 22, 2019 · 7 comments · May be fixed by #1974
Open

Make PackageName default to ChocolateyPackageName #1716

FranklinYu opened this issue Jan 22, 2019 · 7 comments · May be fixed by #1974

Comments

@FranklinYu
Copy link
Contributor

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.

@ferventcoder
Copy link
Member

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

@IronPenguin4179
Copy link

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

@cowmanjoe
Copy link
Contributor

cowmanjoe commented Dec 29, 2019

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

@cowmanjoe
Copy link
Contributor

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

cowmanjoe added a commit to cowmanjoe/choco that referenced this issue Dec 30, 2019
Set default value of packageName to $env:chocolateyPackageName for
Install-ChocolateyZipPackage and Get-ChocolateyUnzip. This is usually
the value used as default in install scripts, so this can reduce the
number of necessary parameters specified.
@FranklinYu
Copy link
Contributor Author

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

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

@cowmanjoe
Copy link
Contributor

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.

@FranklinYu
Copy link
Contributor Author

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.

@vexx32 vexx32 modified the milestones: 0.11.x, Future, Future_ Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants