Skip to content
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

[Feature] Update app name and version for easier switching. #6247

Open
maiq123 opened this issue Dec 18, 2024 · 3 comments
Open

[Feature] Update app name and version for easier switching. #6247

maiq123 opened this issue Dec 18, 2024 · 3 comments

Comments

@maiq123
Copy link

maiq123 commented Dec 18, 2024

Is it possible to update app name for easier switching?

For example, I work with many Java, maven, tomcat versions and often need to reset versions in my day to day routine. I have installed corretto-lts-jdk and have 3 versions of that. 8, 11, 17. Everytime I have to switch, I have to type the full package name and full version. Is it possible to reduce this to associate an alias specific to an app so that if need to switch to different jdk, I can only type scoop reset java@17???

This would be a handy feature to have if its not supported already.

Thanks

@HUMORCE
Copy link
Member

HUMORCE commented Dec 28, 2024

scoop add alias java11 "scoop reset zulu11-jdk; scoop reset <java_tools>-11; ..." then you can switch to java11 env by execute scoop java11

I will do this for manage more apps:
scoop add alias switch "@(app,version) ...", it just link a script to a scoop alias.

If you trying write a complex script for alias, just create an empty alias them open it with IDE code ~/scoop/shim/scoop-<alias_name>.ps1

@maiq123
Copy link
Author

maiq123 commented Jan 8, 2025

I understand what you mean, but what about managing different packages with different versions? I think I would need multiple scripts for different packages and versions. For example if I create a script that will accept an app and version as an argument, I would still have to use the app name to reset and if I hardcode an app name to an alias in script, that would mean to have multiple scripts for each app. Java11 was just an example and I have about 50 or so packages.

A workaround can be to either create a script that performs a check on app name and matches to the most similar one for example If I pass in java as an argument to the script and version number, it would check if java is passed then it would simply reset correto-lts-jdk@version. But this would be an lengthy task to create a script for 50+ packages. Automation of that would be really handy which is basically what I'm asking as an enhancement, so adding an alias to a name of package would simply add a check in the script.

I hope I make sense.

@HUMORCE
Copy link
Member

HUMORCE commented Jan 8, 2025

First, Scoop is closer to a general package manager. Is there an equivalent solution in the java community? I don't write java and I'd be happy to know that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants