Skip to content

Commit 75b993f

Browse files
authored
Fix trim_model.sh: Prevent invalid arguments when extra is empty [skip ci] (#148)
When the `extra` variable is empty, the script generates two single quotes, causing errors in argument parsing for the Java command. This commit ensures that `extra` is handled properly to avoid such issues.
1 parent 33d1cd5 commit 75b993f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

trim_model.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ function relabel_and_color() {
4343
echo "State pruning disabled"
4444
extra=''
4545
fi
46-
echo java -jar "$EXP_SCRIPTS_DIR"/dot-trimmer.jar -r "$REPL_FILE" -i "$input_model" -o "$relabelled_model" -t "$other_thr" -pc "$COLOR_FILE" "$extra"
47-
java -jar "$EXP_SCRIPTS_DIR"/dot-trimmer.jar -r "$REPL_FILE" -i "$input_model" -o "$relabelled_model" -t "$other_thr" -cp "$COLOR_FILE" "$extra"
46+
command="java -jar $EXP_SCRIPTS_DIR/dot-trimmer.jar -r $REPL_FILE -i $input_model -o $relabelled_model -t $other_thr -cp $COLOR_FILE $extra"
47+
echo $command
48+
eval "$command"
4849
}
4950

5051
# merges (edges of) transitions connecting the same states by placing them on the same arrow in stacked formation

0 commit comments

Comments
 (0)