Skip to content

Commit

Permalink
fix: determining executable files on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
RicheyJang committed Jul 8, 2022
1 parent a5b9abe commit 566ef7b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/inspection/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,8 @@ func decompressFileTo(fr io.Reader, destPath string) error {

// 是否为可执行文件
func isExecutable(file fs.FileInfo) bool {
if runtime.GOOS == "windows" {
return !file.IsDir() && strings.HasSuffix(file.Name(), ".exe")
}
return !file.IsDir() && (file.Mode().Perm()&os.FileMode(0111)) == 0111
}

0 comments on commit 566ef7b

Please sign in to comment.