Remove pre-existing config directory during init, structure Windows config directory more similarly to UNIX

This commit is contained in:
2024-05-16 21:40:02 -04:00
parent a70e92fb14
commit cfb2890b8f
4 changed files with 30 additions and 35 deletions
-18
View File
@@ -3,29 +3,11 @@
package backend
import (
"fmt"
"os"
)
const FallbackEditor = "vi" // vi is pre-installed on most UNIX systems
// DirInit creates the libmutton directories
func DirInit() {
// create EntryRoot
err := os.MkdirAll(EntryRoot, 0700)
if err != nil {
fmt.Println(AnsiError + "Failed to create \"" + EntryRoot + "\":" + err.Error() + AnsiReset)
os.Exit(1)
}
// create config directory w/devices subdirectory
err = os.MkdirAll(ConfigDir+"/devices", 0700)
if err != nil {
fmt.Println(AnsiError + "Failed to create \"" + ConfigDir + "\":" + err.Error() + AnsiReset)
os.Exit(1)
}
}
// textEditorFallback returns the value of the $EDITOR environment variable, or FallbackEditor if it is not set
func textEditorFallback() string {
// ensure textEditor is set