Skip to content

Commit d30abe3

Browse files
committed
[middle] Fix data path not creating on Linux
1 parent 0b46f5f commit d30abe3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

middle/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,21 @@ func GetUserData() *UserData {
5151

5252
// GetDataPath returns the path to the installer's data path.
5353
func GetDataPath() string {
54+
dirs := appdir.New("replugged-installer")
55+
data := dirs.UserData()
56+
5457
// We LOVE platform-specific hacks.
5558
// Fixes the running-as-root $HOME issue.
5659
if IsLinux() {
5760
userData := GetUserData()
5861
if userData.Name != "" {
5962
usr := strings.TrimSuffix(userData.Name, "\n")
60-
return fmt.Sprintf("/home/%s/.local/share/replugged-installer", usr)
63+
data = fmt.Sprintf("/home/%s/.local/share/replugged-installer", usr)
6164
} else {
6265
return ""
6366
}
6467
}
6568

66-
dirs := appdir.New("replugged-installer")
67-
data := dirs.UserData()
68-
6969
if err := os.MkdirAll(data, 0755); err != nil {
7070
panic(err)
7171
}

0 commit comments

Comments
 (0)