mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-15 21:37:09 +09:00
Automatically create ~/.config or if it does not exist
This commit is contained in:
@@ -80,9 +80,15 @@ func InitConfigDir() {
|
|||||||
TermMessage("Error finding your home directory\nCan't load syntax files")
|
TermMessage("Error finding your home directory\nCan't load syntax files")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
configDir = home + "/.config/micro"
|
xdgHome = home + "/.config"
|
||||||
} else {
|
}
|
||||||
configDir = xdgHome + "/micro"
|
configDir = xdgHome + "/micro"
|
||||||
|
|
||||||
|
if _, err := os.Stat(xdgHome); os.IsNotExist(err) {
|
||||||
|
err = os.Mkdir(xdgHome, os.ModePerm)
|
||||||
|
if err != nil {
|
||||||
|
TermMessage("Error creating XDG_CONFIG_HOME directory: " + err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := os.Stat(configDir); os.IsNotExist(err) {
|
if _, err := os.Stat(configDir); os.IsNotExist(err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user