Support store settings (#28)

This commit is contained in:
Maxim Baz
2019-03-16 13:59:20 +01:00
committed by GitHub
parent 800aced875
commit cbbf6b73ff
2 changed files with 15 additions and 5 deletions

View File

@@ -64,8 +64,13 @@ func fetchDecryptedContents(request *request) {
}
store.Path = normalizedStorePath
gpgPath := request.Settings.GpgPath
if gpgPath != "" {
var gpgPath string
if store.Settings.GpgPath != "" || request.Settings.GpgPath != "" {
if store.Settings.GpgPath != "" {
gpgPath = store.Settings.GpgPath
} else {
gpgPath = request.Settings.GpgPath
}
err = validateGpgBinary(gpgPath)
if err != nil {
log.Errorf(

View File

@@ -11,10 +11,15 @@ import (
log "github.com/sirupsen/logrus"
)
type storeSettings struct {
GpgPath string `json:"gpgPath"`
}
type store struct {
ID string `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
Settings storeSettings `json:"settings"`
}
type settings struct {