Skip to content

Commit 655be92

Browse files
committed
Addressed PR feedback
1 parent 3dca1d8 commit 655be92

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

scripts/edit/vc/lodestar/export_asdb.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ if docker compose ps --format '{{.Status}}' vc-lodestar 2>/dev/null | grep -qi r
8787
exit 1
8888
fi
8989

90-
# Create output directory if it doesn't exist
90+
# Make paths absolute for docker bind mount
91+
if [[ "$OUTPUT_FILE" != /* ]]; then
92+
OUTPUT_FILE="$(pwd)/$OUTPUT_FILE"
93+
fi
9194
OUTPUT_DIR=$(dirname "$OUTPUT_FILE")
92-
mkdir -p "$OUTPUT_DIR"
9395

94-
# Make OUTPUT_DIR absolute for docker bind mount
95-
if [[ "$OUTPUT_DIR" != /* ]]; then
96-
OUTPUT_DIR="$(pwd)/$OUTPUT_DIR"
97-
fi
96+
# Create output directory if it doesn't exist
97+
mkdir -p "$OUTPUT_DIR"
9898

9999
echo "Exporting slashing protection data using vc-lodestar container..."
100100

@@ -112,8 +112,13 @@ if ! docker compose run --rm -T \
112112
exit 1
113113
fi
114114

115-
# Move to correct output file if different from default
115+
# Fix file ownership (docker creates it as root)
116116
EXPORTED_FILE="$OUTPUT_DIR/slashing-protection.json"
117+
if [ -f "$EXPORTED_FILE" ]; then
118+
sudo chown "$(id -u):$(id -g)" "$EXPORTED_FILE"
119+
fi
120+
121+
# Move to correct output file if different from default
117122
if [ "$EXPORTED_FILE" != "$OUTPUT_FILE" ]; then
118123
mv "$EXPORTED_FILE" "$OUTPUT_FILE"
119124
fi

0 commit comments

Comments
 (0)