Skip to content

Commit aab3d92

Browse files
inline initialization check into persistent_volume_version
1 parent e76e215 commit aab3d92

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

start

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -337,20 +337,21 @@ function set_pg_password() {
337337

338338
}
339339

340-
function is_initialized_volume() {
341-
[ -f "$STELLAR_HOME/.quickstart-version.json" ] || \
342-
[ -f "$PGHOME/.quickstart-initialized" ] || \
343-
[ -f "$COREHOME/.quickstart-initialized" ] || \
344-
[ -f "$HZHOME/.quickstart-initialized" ] || \
345-
[ -f "$STELLAR_RPC_HOME/.quickstart-initialized" ] || \
346-
[ -f "$GALEXIEHOME/.quickstart-initialized" ]
347-
}
348-
349340
function persistent_volume_version() {
350341
local version_file="$STELLAR_HOME/.quickstart-version.json"
351342

343+
local is_initialized_volume=$( \
344+
[ -f "$version_file" ] || \
345+
[ -f "$PGHOME/.quickstart-initialized" ] || \
346+
[ -f "$COREHOME/.quickstart-initialized" ] || \
347+
[ -f "$HZHOME/.quickstart-initialized" ] || \
348+
[ -f "$STELLAR_RPC_HOME/.quickstart-initialized" ] || \
349+
[ -f "$GALEXIEHOME/.quickstart-initialized" ]; \
350+
echo $? \
351+
)
352+
352353
# Save version info on first initialization
353-
if ! is_initialized_volume; then
354+
if [ "$is_initialized_volume" != "0" ]; then
354355
jq -n --arg revision "$REVISION" --arg image "$IMAGE_NAME" \
355356
'{revision: $revision, image: $image}' > "$version_file"
356357
if [ -n "$IMAGE_NAME" ]; then

0 commit comments

Comments
 (0)