mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-31 06:16:35 -04:00
Refactor for better modularity (share more code among edit functions, rename "offline" package to "backend"
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
//go:build windows
|
||||
|
||||
package backend
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
const FallbackEditor = "nvim" // since there is no pre-installed CLI editor on Windows, default to the most popular one
|
||||
|
||||
// dirInit creates the libmutton directories
|
||||
func dirInit() {
|
||||
// create EntryRoot (includes config directory on Windows)
|
||||
err := os.MkdirAll(EntryRoot, 0700)
|
||||
if err != nil {
|
||||
fmt.Println(AnsiError + "Failed to create \"" + EntryRoot + "\":" + err.Error() + AnsiReset)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// textEditorFallback returns FallbackEditor
|
||||
func textEditorFallback() string {
|
||||
return FallbackEditor
|
||||
}
|
||||
Reference in New Issue
Block a user