fix umask for windows
Some checks failed
GoReleaser / goreleaser (push) Has been cancelled
Release Docker Build / docker (push) Has been cancelled

This commit is contained in:
Mukhtar Akere
2025-03-23 07:14:46 +01:00
parent fce0fc0215
commit dc6ee2f020
3 changed files with 18 additions and 3 deletions

View File

@@ -16,7 +16,6 @@ import (
"runtime/debug"
"strconv"
"sync"
"syscall"
)
func Start(ctx context.Context) error {
@@ -26,8 +25,7 @@ func Start(ctx context.Context) error {
if err != nil {
return fmt.Errorf("invalid UMASK value: %s", umaskStr)
}
// Set umask
syscall.Umask(int(umask))
SetUmask(int(umask))
}
cfg := config.GetConfig()

View File

@@ -0,0 +1,9 @@
//go:build !windows
package decypharr
import "syscall"
func SetUmask(umask int) {
syscall.Umask(umask)
}

View File

@@ -0,0 +1,8 @@
//go:build windows
// +build windows
package decypharr
func SetUmask(umask int) {
// No-op on Windows
}