Skip to content

Commit

Permalink
Run "git init" if .git doesn't exist (#1695)
Browse files Browse the repository at this point in the history
  • Loading branch information
dagood authored Aug 5, 2020
1 parent 76ed853 commit 3b7e22f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ if [ -z "${HOME:-}" ]; then
mkdir "$HOME"
fi

# If .git doesn't exist at the repo root, create it. It's required for the build to work. The very
# prominent source tar.gz and zip files created by GitHub don't include it, so it's worth having a
# fallback here. See https://github.com/dotnet/source-build/issues/1646 for details.
if [ ! -e "$scriptroot/.git" ]; then
(
cd "$scriptroot"
git init
)
fi

if grep -q '\(/docker/\|/docker-\)' "/proc/1/cgroup"; then
export DotNetRunningInDocker=1
fi
Expand Down

0 comments on commit 3b7e22f

Please sign in to comment.