Skip to content

hash -d inside print-env-script can return exit code 1 #54690

@nagilson

Description

@nagilson

Discussed in #54648

Originally posted by jjonescz June 9, 2026
I'm trying to use dotnetup in CI like this:

curl -fsSL https://aka.ms/dotnetup/get-dotnetup.sh | bash -s -- --install-dir "$HOME/.dotnetup"
export PATH="$HOME/.dotnetup:$PATH"
dotnetup sdk install
source <(dotnetup print-env-script)

(But if there is an easier way, please let me know.)

The problem is that dotnetup print-env-script generates hash -d commands which apparently can return exit code 1. Hence my script fails (because it has set -e like any good script should). I needed to use source <(dotnetup print-env-script) || true but that's not a pretty workaround - it could hide other failures.

Also, btw, does dotnetup sdk install has some explicit option to say "install from global.json"? I don't like that it's only implied now. - tracked in #54692

Metadata

Metadata

Assignees

Labels

dotnetupWork items around the proposed `dotnetup` bootstrapper/toolchain management tool and libraryuntriagedRequest triage from a team member

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions