Add defaultPath to configure response (#4)

This commit is contained in:
Erayd
2018-04-12 21:21:26 +12:00
committed by GitHub
parent 8f55396bd6
commit 90ca691ac9
2 changed files with 4 additions and 1 deletions

View File

@@ -98,6 +98,7 @@ is alive, determine the version at startup, and provide per-store defaults.
   “status”: “ok”,
   “version”: <int>
   “response”: {
"defaultPath": "/path/to/default/store",
       “storeSettings”: {
           “storeName”: <raw contents of storePath/.browserpass.json>
       }

View File

@@ -93,7 +93,9 @@ function configure()
fi
done
OUTPUT='{}'
[ -n "$PASSWORD_STORE_DIR" ] || PASSWORD_STORE_DIR="~/.password-store"
OUTPUT="$(jq -n --arg defaultPath "$PASSWORD_STORE_DIR" '.defaultPath = $defaultPath')"
for STORE in "${!STORES[@]}"; do
OUTPUT=$(jq --arg store "$STORE" --arg settings "${STORES[$STORE]}" '.storeSettings[$store] = $settings' <<< "$OUTPUT")
done