Skip to content

Commit 1ac84d4

Browse files
fawickadg
authored andcommitted
build: Fix bootstrap.bash for official source tarballs
At the moment, bootstrap.bash assumes it is called from a git working copy. Hence, it fails to complete when running in an unpacked official source tarball where .git and .gitignore do not exist. This fix adds a test for existence for .git and a -f switch for the removal of .gitignore. Fixes #12223 Change-Id: I7f305b83b38d5115504932bd38dadb7bdeb5d487 Reviewed-on: https://go-review.googlesource.com/13770 Reviewed-by: Dave Cheney <[email protected]> Reviewed-by: Andrew Gerrand <[email protected]>
1 parent e92d0d8 commit 1ac84d4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bootstrap.bash

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ cp -R "$src" "$targ"
3535
cd "$targ"
3636
echo
3737
echo "#### Cleaning $targ"
38-
rm .gitignore
39-
git clean -f -d
38+
rm -f .gitignore
39+
if [ -e .git ]; then
40+
git clean -f -d
41+
fi
4042
echo
4143
echo "#### Building $targ"
4244
echo

0 commit comments

Comments
 (0)