asdf icon indicating copy to clipboard operation
asdf copied to clipboard

fix: reshim local path (#1286)

Open alexezio opened this issue 2 years ago • 9 comments

Summary

change sed delimiter character from / to |

to prevent reshim local path error(sed delimiter character conflict)

Fixes: #1286

Other Information

maybe we could use a better delimiter character for this scenario?

alexezio avatar Jul 04 '22 14:07 alexezio

Can you add a test case for regression testing?

jthegedus avatar Jul 05 '22 01:07 jthegedus

Can you add a test case for regression testing?

Hi, I add a test case for testing, could you please review the change?

alexezio avatar Jul 05 '22 03:07 alexezio

another question need help~ I pass the test suite case in my MacBook, but can't be passed here, is there any approach to solve this issue? WeChatc0ee071bb577f9c09804984839ed7244

alexezio avatar Jul 06 '22 00:07 alexezio

another question need help~ I pass the test suite case in my MacBook, but can't be passed here, is there any approach to solve this issue? WeChatc0ee071bb577f9c09804984839ed7244

This can be challenging. It looks like the new test is failing in Github actions because one of the commands it runs exited with a non-zero exit status. I typically echo the $output of the command before asserting the exit code is 0 when debugging issues like that. Usually $output holds the answer to the issue, and BATS will take whatever you print and render it to the test output so it will be visible in the runner output. Hope this helps!

Stratus3D avatar Jul 06 '22 21:07 Stratus3D

can anyone review the new change?

alexezio avatar Jul 13 '22 01:07 alexezio

@alexezio please review the failed status checks

jthegedus avatar Jul 17 '22 15:07 jthegedus

@jthegedus hello, jthegedus: I fix the unit-test issue, could you please approve for auto-test again?

alexezio avatar Jul 30 '22 05:07 alexezio

It seems like all unit-test are passed, so could this pr be approved?

alexezio avatar Aug 04 '22 01:08 alexezio

@alexezio Sorry for my absence and delay here. Can you address the Shellcheck issue?

In lib/commands/reshim.bash line 93: sed -i.bak -e '$i\'$'\n'"# asdf-plugin: ${plugin_name} ${version}" "$shim_path" ^-- SC1003 (info): Want to escape a single quote? echo 'This is how it'\''s done'.

For more information: https://www.shellcheck.net/wiki/SC1003 -- Want to escape a single quote? ec...

jthegedus avatar Aug 30 '22 15:08 jthegedus

@jthegedus hi, sorry for my absence. I check the shellcheck error, and I think that is not a issue. The backslash \ after $i means that insert the text after the backslash to the last line without needed a /pattern/ for the last line. so it can't be quoted. the $ symol that surrended with single quote string represent the end of old lines. And I try to solve the shell format, but it doesn't work. So could you pelease review this?

alexezio avatar Dec 01 '22 10:12 alexezio

From @dylan-chong from - https://github.com/asdf-vm/asdf/pull/1311#issuecomment-1200322501

@alexezio This means that the change to the sed pattern in your PR https://github.com/asdf-vm/asdf/pull/1287 is not longer required. But it would still be great to merge the test that you wrote in your PR. I have checked and that test passes in this branch, but I don't want to steal your contribution so I'll let you commit that :)

Let's:

  • remove the changes here to lib/commands/reshim.bash
  • rebase
  • resolve conflicts for test/

and get this test case in and close out this PR.

jthegedus avatar Dec 23 '22 09:12 jthegedus

Thanks for writing the test for this @alexezio ! And thanks for getting this merged @jthegedus !

Stratus3D avatar Apr 11 '23 12:04 Stratus3D