Skip to content

Commit

Permalink
Make files in the go-path readable if they aren't.
Browse files Browse the repository at this point in the history
Go modules writes a bunch of stuff in $GOPATH/pkg/mod as read-only.
Standard rm -rf throws an error when it encounters read-only files.
So find the files that are read-only and make them not read-only.

See also: golang/go#27161
  • Loading branch information
Edward Muller authored and epk committed Feb 5, 2020
1 parent aee4c01 commit 071bfd4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,12 @@ ensureGo() {
if [ -d "${goPath}" ]; then
step "Using ${goVersion}"
else
rm -rf ${cache}/* #For a go version change, we delete everything
#For a go version change, we delete everything
step "New Go Version, clearing old cache"
if [ -d "${cache}/go-path" ]; then
find "${cache}/go-path" ! -perm -u=w -print0 | xargs -0 chmod u+w 2>&1
fi
rm -rf ${cache}/*
case "${goVersion}" in
devel*)
local bGoVersion="$(expandVer ${DefaultGoVersion})"
Expand Down

0 comments on commit 071bfd4

Please sign in to comment.