diff --git a/cmd/decypharr/main.go b/cmd/decypharr/main.go index 384ffae..1c04214 100644 --- a/cmd/decypharr/main.go +++ b/cmd/decypharr/main.go @@ -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() diff --git a/cmd/decypharr/umask_unix.go b/cmd/decypharr/umask_unix.go new file mode 100644 index 0000000..23636b4 --- /dev/null +++ b/cmd/decypharr/umask_unix.go @@ -0,0 +1,9 @@ +//go:build !windows + +package decypharr + +import "syscall" + +func SetUmask(umask int) { + syscall.Umask(umask) +} diff --git a/cmd/decypharr/umask_win.go b/cmd/decypharr/umask_win.go new file mode 100644 index 0000000..06299cc --- /dev/null +++ b/cmd/decypharr/umask_win.go @@ -0,0 +1,8 @@ +//go:build windows +// +build windows + +package decypharr + +func SetUmask(umask int) { + // No-op on Windows +}