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

feat: allow overriding install path #837

Merged
merged 1 commit into from Mar 18, 2024
Merged

Conversation

mistydemeo
Copy link
Contributor

This provides a way to override any configuration on the installer and install to a location specified by a new environment variable. It provides a more predictable way to insist that it gets installed to a specific place, regardless of how the installer was built.

Possible fix for axodotdev/axoupdater#32, where we'd like to be able to install a new version to exactly the same path as the previous version.

@Gankra
Copy link
Member

Gankra commented Mar 7, 2024

is there any reason to do this an env-var and not a cli flag..? i suppose for curl-sh it's harder

@mistydemeo
Copy link
Contributor Author

This also strikes me as a power user/internal feature, which feels better-suited to being an environment variable instead of a CLI flag.

@Gankra
Copy link
Member

Gankra commented Mar 8, 2024

It is a power-user feature, but it's also an end-power-user feature, right? like they won't even know what "cargo-dist" is?

@mistydemeo
Copy link
Contributor Author

I don't think end users should use this; this is a feature for the updater which needs fine-grained control over installation location. That other people can use it is kind of a bonus.

@Gankra
Copy link
Member

Gankra commented Mar 8, 2024

oh I thought this was also motivated by some other astral asks to let the end-user install to a custom dir...

@mistydemeo
Copy link
Contributor Author

Oh, I think I totally missed that side of the conversation.

@mistydemeo
Copy link
Contributor Author

One more factor: the shell installer errors on unrecognized flags. An environment variable helps us guard against the possibility of using an installer version that doesn't recognize the new flag, because it'll silently ignore the instruction instead of hard-erroring and not performing the install. eg

$ ./axolotlsay-installer.sh --force-install-prefix /tmp/axolotlsay
ERROR: unknown option --force-install-prefix

Copy link
Member

@Gankra Gankra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one issue but basic idea seems fine

cargo-dist/templates/installer/installer.sh.j2 Outdated Show resolved Hide resolved
This provides a way to override any configuration on the installer and
install to a location specified by a new environment variable. It provides
a more predictable way to insist that it gets installed to a specific place,
regardless of how the installer was built.

Possible fix for axodotdev/axoupdater#32, where we'd like to be able to
install a new version to exactly the same path as the previous version.
@mistydemeo mistydemeo merged commit 493c120 into main Mar 18, 2024
15 checks passed
@mistydemeo mistydemeo deleted the installer_force_path branch March 18, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants