diff --git a/src/cli/init.go b/src/cli/init.go index 88e4ef2..36f01ae 100644 --- a/src/cli/init.go +++ b/src/cli/init.go @@ -47,18 +47,18 @@ func TempInitCli() { backend.DirInit(false) // write config file (temporarily assigns sshEntryRoot and sshIsWindows to null to pass initial device ID registration) - backend.WriteConfig(map[string]string{"textEditor": textEditor, "gpgID": gpgID, "sshUser": sshUser, "sshIP": sshIP, "sshPort": sshPort, "sshKey": sshKey, "sshKeyProtected": strconv.FormatBool(sshKeyProtected), "sshEntryRoot": "null", "sshIsWindows": "null"}, false) + backend.WriteConfig([][3]string{{"LIBMUTTON", "textEditor", textEditor}, {"LIBMUTTON", "gpgID", gpgID}, {"LIBMUTTON", "sshUser", sshUser}, {"LIBMUTTON", "sshIP", sshIP}, {"LIBMUTTON", "sshPort", sshPort}, {"LIBMUTTON", "sshKey", sshKey}, {"LIBMUTTON", "sshKeyProtected", strconv.FormatBool(sshKeyProtected)}, {"LIBMUTTON", "sshEntryRoot", "null"}, {"LIBMUTTON", "sshIsWindows", "null"}}, false) // generate and register device ID sshEntryRoot, sshIsWindows := sync.DeviceIDGen() // update config file with sshEntryRoot and sshIsWindows - backend.WriteConfig(map[string]string{"sshEntryRoot": sshEntryRoot, "sshIsWindows": sshIsWindows}, true) + backend.WriteConfig([][3]string{{"LIBMUTTON", "sshEntryRoot", sshEntryRoot}, {"LIBMUTTON", "sshIsWindows", sshIsWindows}}, true) } else { // initialize libmutton directories backend.DirInit(false) // write config file - backend.WriteConfig(map[string]string{"textEditor": textEditor, "gpgID": gpgID}, false) + backend.WriteConfig([][3]string{{"LIBMUTTON", "textEditor", textEditor}, {"LIBMUTTON", "gpgID", gpgID}}, false) } } diff --git a/src/cli/initUNIX.go b/src/cli/initUNIX.go index 1c63fb5..e79bdad 100644 --- a/src/cli/initUNIX.go +++ b/src/cli/initUNIX.go @@ -10,7 +10,6 @@ const fallbackEditor = "vi" // vi is pre-installed on most UNIX systems // textEditorFallback returns the value of the $EDITOR environment variable, or FallbackEditor if it is not set func textEditorFallback() string { - // ensure textEditor is set textEditor := os.Getenv("EDITOR") if textEditor == "" { textEditor = fallbackEditor