Skip to content

Commit

Permalink
Fix Dir
Browse files Browse the repository at this point in the history
  • Loading branch information
thororen1234 committed Jul 19, 2024
1 parent 27fb1df commit 6d5db15
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions patcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
)

var BaseDir string
var BaseDirErr error
var EquicordAsarPath string

func init() {
Expand All @@ -30,8 +31,18 @@ func init() {
Log.Debug("Using UserConfig")
BaseDir = appdir.New("Equicord").UserConfig()
}

if dir := os.Getenv("EQUICORD_ASAR_FILE"); dir != "" {
dir := os.Getenv("EQUICORD_ASAR_FILE")
if dir == "" {
if !ExistsFile(BaseDir) {
BaseDirErr = os.Mkdir(BaseDir, 0755)
if BaseDirErr != nil {
Log.Error("Failed to create", BaseDir, BaseDirErr)
} else {
BaseDirErr = FixOwnership(BaseDir)
}
}
}
if dir != "" {
Log.Debug("Using EQUICORD_ASAR_FILE")
EquicordAsarPath = dir
} else {
Expand Down

0 comments on commit 6d5db15

Please sign in to comment.