Better OS checks

This commit is contained in:
AlexSSD7 2023-09-02 11:28:23 +01:00
commit 58039acc3c
9 changed files with 48 additions and 29 deletions

View file

@ -4,10 +4,10 @@ import (
"fmt"
"os"
"path/filepath"
"runtime"
"log/slog"
"github.com/AlexSSD7/linsk/osspecifics"
"github.com/spf13/cobra"
)
@ -64,7 +64,7 @@ func init() {
slog.Error("Failed to get user home directory, will use a local directory as a fallback", "error", err.Error(), "dir", defaultDataDir)
} else {
homeDirName := ".linsk"
if runtime.GOOS == "windows" {
if osspecifics.IsWindows() {
homeDirName = "Linsk"
}