Eureka/tools/dotnet-self-env.sh
Eureka ad6e3108b9 tools: dotnet-self wrapper, env outside the worktree, subshell warning
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 11:37:06 +00:00

20 lines
1 KiB
Shell
Executable file

# Env for dotnet in a Self whose HOME is read-only. Prefer tools/dotnet-self,
# which applies this to one dotnet command only.
#
# WARNING: sourcing this in your own shell exports HOME, which moves git and gh
# config and credentials for every later command in that shell. Source it in a
# subshell or per command: ( . tools/dotnet-self-env.sh; dotnet build )
#
# DOTNET_SELF_HOME defaults to a per-user 0700 directory outside any worktree;
# set it to override. A directory inside a repo needs a .git/info/exclude entry.
DOTNET_SELF_HOME="${DOTNET_SELF_HOME:-${XDG_CACHE_HOME:-${TMPDIR:-/tmp}}/dotnet-self-home-$(id -u)}"
mkdir -p "$DOTNET_SELF_HOME" && chmod 700 "$DOTNET_SELF_HOME"
export HOME="$DOTNET_SELF_HOME"
export DOTNET_CLI_HOME="$DOTNET_SELF_HOME"
export NUGET_PACKAGES="$DOTNET_SELF_HOME/.nuget/packages"
export DOTNET_NOLOGO=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export MSBUILDDISABLENODEREUSE=1
export UseSharedCompilation=false
export DOTNET_CLI_USE_MSBUILD_SERVER=0