Skip to content

Commit f11d1e5

Browse files
committed
fix: quote variables and improve robustness of flow.sh
1 parent 0d71df5 commit f11d1e5

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

‎flow/scripts/flow.sh‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
#!/usr/bin/env bash
2-
set -u -eo pipefail
3-
mkdir -p $RESULTS_DIR $LOG_DIR $REPORTS_DIR $OBJECTS_DIR
4-
echo Running $2.tcl, stage $1
5-
(trap 'mv $LOG_DIR/$1.tmp.log $LOG_DIR/$1.log' EXIT; \
6-
$OPENROAD_EXE $OPENROAD_ARGS -exit $SCRIPTS_DIR/noop.tcl 2>&1 >$LOG_DIR/$1.tmp.log; \
7-
eval "$TIME_CMD $OPENROAD_CMD -no_splash $SCRIPTS_DIR/$2.tcl -metrics $LOG_DIR/$1.json" 2>&1 | \
8-
tee -a $(realpath $LOG_DIR/$1.tmp.log))
2+
set -euo pipefail
3+
4+
mkdir -p "$RESULTS_DIR" "$LOG_DIR" "$REPORTS_DIR" "$OBJECTS_DIR"
5+
6+
echo "Running $2.tcl, stage $1"
7+
8+
(
9+
trap 'mv "$LOG_DIR/$1.tmp.log" "$LOG_DIR/$1.log"' EXIT
10+
11+
"$OPENROAD_EXE" $OPENROAD_ARGS -exit "$SCRIPTS_DIR/noop.tcl" \
12+
>"$LOG_DIR/$1.tmp.log" 2>&1
13+
14+
eval "$TIME_CMD $OPENROAD_CMD -no_splash \"$SCRIPTS_DIR/$2.tcl\" -metrics \"$LOG_DIR/$1.json\"" \
15+
2>&1 | tee -a "$(realpath "$LOG_DIR/$1.tmp.log")"
16+
)
17+
918
# Log the hash for this step. The summary "make elapsed" in "make finish",
1019
# will not have all the .odb files for the bazel-orfs use-case.
11-
$PYTHON_EXE $UTILS_DIR/genElapsedTime.py --match $1 -d $LOG_DIR | tee -a $(realpath $LOG_DIR/$1.log)
20+
"$PYTHON_EXE" "$UTILS_DIR/genElapsedTime.py" --match "$1" -d "$LOG_DIR" \
21+
| tee -a "$(realpath "$LOG_DIR/$1.log")"

0 commit comments

Comments
 (0)