mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-21 09:06:46 +09:00
refactor: clarify GOOS detection (#39620)
Introduce `consts.IsWindows`, now it's clearer to see how Windows build works
This commit is contained in:
1 parent
052f660ba5
commit
1065f03454
16 files changed
+44
-37
No files matched your search
@@ -8,8 +8,8 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"gitea.dev/modules/consts"
|
||||
"gitea.dev/modules/git/gitrepo"
|
||||
"gitea.dev/modules/setting"
|
||||
"gitea.dev/modules/util"
|
||||
@@ -156,7 +156,7 @@ func createDelegateHooks(hookDir string) (err error) {
|
||||
|
||||
func checkExecutable(filename string) bool {
|
||||
// windows has no concept of a executable bit
|
||||
if runtime.GOOS == "windows" {
|
||||
if consts.IsWindows {
|
||||
return true
|
||||
}
|
||||
fileInfo, err := os.Stat(filename)
|
||||
|
||||
Reference in new issue
Block a user