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

dotnet-install.sh fails when dot-sourced from the command line #519

Open
2 tasks
JayBazuzi opened this issue Jul 20, 2024 · 2 comments
Open
2 tasks

dotnet-install.sh fails when dot-sourced from the command line #519

JayBazuzi opened this issue Jul 20, 2024 · 2 comments

Comments

@JayBazuzi
Copy link

  • This issue is blocking
  • This issue is causing unreasonable pain

On a Mac running ZSH:

> . dotnet-install.sh   
(eval):1: FUNCNAME[0]: parameter not set
(eval):1: FUNCNAME[0]: parameter not set

and then my shell closes, ouch!

@JayBazuzi JayBazuzi changed the title dotnet-install.sh fails when dot-sourced with no arguments dotnet-install.sh fails when dot-sourced from the command line Jul 20, 2024
@MichalPavlik MichalPavlik transferred this issue from dotnet/arcade Sep 24, 2024
@MichalPavlik
Copy link
Member

I can repro using zsh 5.8 (x86_64-ubuntu-linux-gnu)

@MichalPavlik
Copy link
Member

MichalPavlik commented Sep 26, 2024

I think I know the reason. The script instructs shell to exit if an unset variable is encountered (via set -u). The FUNCNAME[0] located here:

invocation='say_verbose "Calling: ${yellow:-}${FUNCNAME[0]} ${green:-}$*${normal:-}"'

is a Bash specific thing. ZSH uses funcstack, but I'm not sure why it fails only when dot-sourced.

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

No branches or pull requests

2 participants