asdf-plugin-template icon indicating copy to clipboard operation
asdf-plugin-template copied to clipboard

[question] Confusion on ASDF_INSTALL_PATH and ASDF_DOWNLOAD_PATH

Open andreaTP opened this issue 2 years ago • 4 comments

Describe the bug

First of all thanks a lot for the great tool, I'm happily using it since years now 🙂

Using this template as a base I'm trying to develop a plugin for Kiota. The current version is here: https://github.com/andreaTP/asdf-kiota

To get things working I have had to craft the script to sanitize the paths passed by the env variables, done here. Unfortunately, this doesn't (probably) play nicely with the GH actions that are still failing.

Without the mangling, the variables are looking pretty strange, e.g.:

ASDF_DOWNLOAD_PATH=/Users/<user>/.asdf/downloads/kiota/https://github.com/microsoft/kiota/releases/tag/v1.1.3

Here I'm asking for guidance on how to proceed to fix the CI and possibly follow best practices in the plugin development. Thanks in advance!

andreaTP avatar Apr 19 '23 18:04 andreaTP

Related to https://github.com/asdf-vm/asdf/issues/1028

jthegedus avatar Apr 19 '23 23:04 jthegedus

The result you're after is:

-ASDF_DOWNLOAD_PATH=/Users/<user>/.asdf/downloads/kiota/https://github.com/microsoft/kiota/releases/tag/v1.1.3
+ASDF_DOWNLOAD_PATH=/Users/<user>/.asdf/downloads/kiota/1.1.3

So you will need to update your code so the version is pulled out of the URL.

This may be related to https://github.com/asdf-vm/asdf-plugin-template/pull/65 So have a look at that code change and see if it fixes your issue

jthegedus avatar Apr 20 '23 01:04 jthegedus

Thanks for the answer @jthegedus ! I think I'm facing this very same issue: https://github.com/asdf-vm/actions/issues/548

I'm on Mac and it looks like the version can come in 2 formats depending on the platform, handling the 2 cases solves the issue for me: https://github.com/andreaTP/asdf-kiota/blob/45f6c1e3cf00b375414fae4f0169a3fc7f48d302/lib/utils.bash#L37-L59

andreaTP avatar Apr 20 '23 09:04 andreaTP

The OP of https://github.com/asdf-vm/actions/issues/548 reported their issue was fixed by a change to the sed in latest-stable. I recommend you try that fix in your plugin https://github.com/asdf-vm/actions/issues/548#issuecomment-1518517064

jthegedus avatar Apr 23 '23 00:04 jthegedus