15 lines
767 B
Bash
Executable file
15 lines
767 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Writes a measurement playbook from pc2-floor-measure.ps1 with the point list given (one `run name fixture env...`
|
|
# per line, read from the file in $1), into $2. Fixtures: $EMPTY (block 83616, an empty live shard), $V1
|
|
# (fees-v1-shards2 shard 0, the adopted v1 shard), $FULL (block-338-shard1, the prototype shard), $ONE (block 56).
|
|
set -euo pipefail
|
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
POINTS="$(tr '\n' ';' < "$1" | sed 's/;$//')"
|
|
python3 - "$HERE/pc2-floor-measure.ps1" "$2" "$POINTS" <<'PY'
|
|
import sys
|
|
src, out, points = sys.argv[1], sys.argv[2], sys.argv[3]
|
|
s = open(src).read()
|
|
s = s.replace("'POINTS_PLACEHOLDER'", "'" + points.replace("'", "''") + "'")
|
|
open(out, 'w').write(s)
|
|
print("wrote", out, "points:", points.count(';') + 1)
|
|
PY
|