summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-05-15 23:38:31 +0700
committerShulhan <ms@kilabit.info>2023-05-15 23:38:45 +0700
commit6fd1ef57498aad5b73808f2b2260ccfe76ae649c (patch)
treeea11878727e06e3dc11d878e30da1cdd8fce3c91
parentf002873db4dca0631960ae4e770b5747e365bae1 (diff)
downloadgotp-6fd1ef57498aad5b73808f2b2260ccfe76ae649c.tar.xz
all: check for zero file on config save
If the file is not set, do nothing.
-rw-r--r--config.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/config.go b/config.go
index fbfcfe0..29a63e3 100644
--- a/config.go
+++ b/config.go
@@ -148,6 +148,10 @@ func (cfg *config) get(name string) (issuer *Issuer, err error) {
// save the config to file.
func (cfg *config) save() (err error) {
+ if len(cfg.file) == 0 {
+ return nil
+ }
+
var (
logp = `save`