mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-31 22:36:41 -04:00
Add offline mode option to libmutton.ini
This commit is contained in:
+2
-1
@@ -47,6 +47,7 @@ func LibmuttonInit(inputCB func(prompt string) string, clientSpecificIniData [][
|
||||
err = cfg.WriteConfig(append(
|
||||
clientSpecificIniData,
|
||||
[][3]string{
|
||||
{"LIBMUTTON", "offlineMode", "false"},
|
||||
{"LIBMUTTON", "sshUser", sshUser},
|
||||
{"LIBMUTTON", "sshIP", sshIP},
|
||||
{"LIBMUTTON", "sshPort", sshPort},
|
||||
@@ -74,7 +75,7 @@ func LibmuttonInit(inputCB func(prompt string) string, clientSpecificIniData [][
|
||||
}
|
||||
// write config file
|
||||
if len(clientSpecificIniData) > 0 { // TODO test passing empty clientSpecificIniData
|
||||
err = cfg.WriteConfig(clientSpecificIniData, nil, false)
|
||||
err = cfg.WriteConfig(append(clientSpecificIniData, [][3]string{{"LIBMUTTON", "offlineMode", "true"}}...), nil, false)
|
||||
if err != nil {
|
||||
return errors.New("unable to write config file: " + err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user