diff --git a/secrets b/secrets index 97676b8..6b18cfe 100755 --- a/secrets +++ b/secrets @@ -1918,7 +1918,10 @@ cmd_which() { local json_manifest="$PWD/$SECRETS_JSON_NAME" if [ -e "$json_manifest" ]; then _check_manifest_file "$json_manifest" - echo "manifest ($SECRETS_JSON_NAME at $json_manifest):" + # EGB-700: surface the manifest schema version (validated == MANIFEST_VERSION + # by _check_manifest_file above) alongside the store format printed earlier. + local mver; mver=$(jq -r '.version // "?"' "$json_manifest") + echo "manifest ($SECRETS_JSON_NAME at $json_manifest, version $mver):" local entry while IFS= read -r entry; do [ -n "$entry" ] || continue diff --git a/test/manifest.bats b/test/manifest.bats index 37564c7..eb5c42a 100644 --- a/test/manifest.bats +++ b/test/manifest.bats @@ -97,6 +97,14 @@ load test_helper [[ "$output" == *".env"* ]] || false } +@test "which prints the manifest version (EGB-700)" { + create_project_dir manifestver + "$SECRETS_BIN" add .env >/dev/null + run "$SECRETS_BIN" which + [ "$status" -eq 0 ] + [[ "$output" == *"version 2"* ]] || false +} + @test "malformed .secrets.json dies with a directed error naming the file" { create_project_dir addproj echo '{ not json' > .secrets.json