1
0
Fork 0

Remove basedir check (#101)

This commit is contained in:
Patryk Niedźwiedziński 2020-10-12 20:48:21 +02:00 committed by GitHub
parent 96fda081bb
commit 926fff0e6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 18 deletions

View File

@ -62,13 +62,8 @@ func Init() error {
configDir = amforaAppData configDir = amforaAppData
} else { } else {
// Unix / POSIX system // Unix / POSIX system
if basedir.ConfigHome == "" {
// Default to ~/.config/amfora
configDir = filepath.Join(home, ".config", "amfora")
} else {
configDir = filepath.Join(basedir.ConfigHome, "amfora") configDir = filepath.Join(basedir.ConfigHome, "amfora")
} }
}
configPath = filepath.Join(configDir, "config.toml") configPath = filepath.Join(configDir, "config.toml")
// Search for a custom new tab // Search for a custom new tab
@ -84,13 +79,8 @@ func Init() error {
tofuDBDir = amforaAppData tofuDBDir = amforaAppData
} else { } else {
// XDG cache dir on POSIX systems // XDG cache dir on POSIX systems
if basedir.CacheHome == "" {
// Default to ~/.cache/amfora
tofuDBDir = filepath.Join(home, ".cache", "amfora")
} else {
tofuDBDir = filepath.Join(basedir.CacheHome, "amfora") tofuDBDir = filepath.Join(basedir.CacheHome, "amfora")
} }
}
tofuDBPath = filepath.Join(tofuDBDir, "tofu.toml") tofuDBPath = filepath.Join(tofuDBDir, "tofu.toml")
// Store bookmarks dir and path // Store bookmarks dir and path
@ -99,13 +89,8 @@ func Init() error {
bkmkDir = amforaAppData bkmkDir = amforaAppData
} else { } else {
// XDG data dir on POSIX systems // XDG data dir on POSIX systems
if basedir.DataHome == "" {
// Default to ~/.local/share/amfora
bkmkDir = filepath.Join(home, ".local", "share", "amfora")
} else {
bkmkDir = filepath.Join(basedir.DataHome, "amfora") bkmkDir = filepath.Join(basedir.DataHome, "amfora")
} }
}
bkmkPath = filepath.Join(bkmkDir, "bookmarks.toml") bkmkPath = filepath.Join(bkmkDir, "bookmarks.toml")
// *** Create necessary files and folders *** // *** Create necessary files and folders ***