-
Notifications
You must be signed in to change notification settings - Fork 832
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
Keep Source #669
Keep Source #669
Conversation
Is there an intent to skip the download if the specific version is already present? |
Another question, what is the plan for a plugin that has a |
@jthegedus yes that is the intent. Although that reminds me I also may implement a |
Good question. I didn't think about that. I was implementing this as something that would be backward compatible with old plugins. I guess this would not result in new plugins working with older versions of asdf. |
Actually, plugins can be backwards compatible with the current version of asdf. All the |
I am going to update my asdf-lua plugin with support for this as a test. |
Is this what you meant @Stratus3D ? Using in asdf-firebase and asdf-gcloud # bin/install
if [ -z "${ASDF_DOWNLOAD_PATH:-}" ]; then
tmp_download_dir=$(mktemp -d -t 'asdf_${plugin_name}_XXXXXX')
trap 'rm -rf "${tmp_download_dir}"' EXIT
printf "run download script for older versions of asdf\\n"
export ASDF_DOWNLOAD_PATH="${tmp_download_dir}"
# download
bash "$(dirname "$0")/download"
fi |
@jthegedus yes. Exactly. Hoping to finish this PR this week. |
…ssed or the always_keep_download config is set to yes
This PR is finally ready for review @asdf-vm/core ! |
Awesome, I'll give it a test with my plugins this weekend 💯 |
Had a chance to test this yet @jthegedus ? |
Sorry mate, not yet. Will try do so tomorrow. Been slammed with work 😫 |
Tested this out, works a treat 👌 One more question though, with |
@jthegedus good question. At first I was thinking not remove the downloads directory when the plugin is uninstalled. But I think problems could arise if a different plugin with the same name were installed. The downloaded files might differ between plugins and cause problems. I think it's best to avoid this by always removing downloads when a plugin is removed. |
Perhaps making the download path be the GitHub username and repo name, like
to
would be another option. Removing downloads when plugin is removed is easier |
That does get around the issue of the downloads being available to a plugin that works differently, but it would make the
If we had to take into account the tool name and some additional plugin identifier like username, these commands would be more complicated. Maybe it is worth it, I am not sure. |
With the way I use asdf, I think I've removed plugins maybe 3-4 times over the last 4 years of using it. Others may use it differently, but to me it doesn't seem to be a common action. |
I would agree that it is not common.
Do we need these additional commands? I think removing all downloads on plugin removal as the default behaviour would be enough no? I get |
Good question. I assumed it would make sense to allow the user to download a version first before installing if they wanted to apply manual patches the source code before installing. Having an |
Summary
download
callback script in plugins. This script will eventually be required.always_keep_download
configuration option.--keep-download
flag for the install command.Fixes: #74
This PR addresses the oldest open issue in our issue tracker! 🎉
Other Information
This PR is the first of two PRs to add this keep source/download management functionality. The next PR will add three new commands to asdf: