Skip to content

Commit

Permalink
Merge pull request #67 from jaypipes/issue66
Browse files Browse the repository at this point in the history
Only attempt chmod of `aws` CLI if not executable
  • Loading branch information
gyuho authored Dec 30, 2019
2 parents b661606 + c640b28 commit a10e56f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/fileutil/fileutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"syscall"
"time"
)

Expand Down Expand Up @@ -79,6 +80,10 @@ func EnsureExecutable(p string) error {
if err != nil {
return fmt.Errorf("error doing stat on %q: %v", p, err)
}
m := s.Mode()
if m&(syscall.S_IXOTH|syscall.S_IXGRP|syscall.S_IXUSR) != 0 {
return nil
}
if err := os.Chmod(p, s.Mode()|0111); err != nil {
return fmt.Errorf("error doing chmod on %q: %v", p, err)
}
Expand Down

0 comments on commit a10e56f

Please sign in to comment.