Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnibs committed Sep 28, 2023
1 parent e4103dd commit 9474112
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions cli/lakeflags/datadir.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,15 @@ func getDefaultDataDir() string {
}
switch runtime.GOOS {
case "windows":
// Windows XP and before didn't have a LOCALAPPDATA, so fallback
// to regular APPDATA when LOCALAPPDATA is not set.
appData := os.Getenv("LOCALAPPDATA")
if appData == "" {
appData = os.Getenv("APPDATA")
}
if appData != "" {
if appData := os.Getenv("LOCALAPPDATA"); appData != "" {
return filepath.Join(appData, "zed")
}
case "darwin":
if homeDir != "" {
return filepath.Join(homeDir, "Library",
"Application Support", "zed")
}
default:
if homeDir != "" {
return filepath.Join(homeDir, ".zed")
// For linux and windows follow the XDG spec which states:
// If $XDG_DATA_HOME is either not set or empty, a default equal to
// $HOME/.local/share should be used.
return filepath.Join(homeDir, ".local", "share", "zed")
}
}
// Return an empty string which will cause an error if a default data
Expand Down

0 comments on commit 9474112

Please sign in to comment.