66
77set -e
88
9+ : ${PROFILE:= release-small}
10+ export PROFILE
11+
912SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
1013PROJECT_ROOT=" $( cd " $SCRIPT_DIR /.." && pwd) "
1114TEMP_DIR=$( mktemp -d)
@@ -27,15 +30,15 @@ echo "=== Safe Traversal Verification ==="
2730
2831# Assume binaries are already built (for CI usage)
2932# Prefer individual binaries for more accurate testing
30- if [ -f " $PROJECT_ROOT /target/release /rm" ]; then
33+ if [ -f " $PROJECT_ROOT /target/${PROFILE} /rm" ]; then
3134 echo " Using individual binaries"
3235 USE_MULTICALL=0
33- elif [ -f " $PROJECT_ROOT /target/release /coreutils" ]; then
36+ elif [ -f " $PROJECT_ROOT /target/${PROFILE} /coreutils" ]; then
3437 echo " Using multicall binary"
3538 USE_MULTICALL=1
36- COREUTILS_BIN=" $PROJECT_ROOT /target/release /coreutils"
39+ COREUTILS_BIN=" $PROJECT_ROOT /target/${PROFILE} /coreutils"
3740else
38- echo " Error: No binaries found. Please build first with 'cargo build --release '"
41+ echo " Error: No binaries found. Please build first with 'cargo build --profile= ${PROFILE} '"
3942 exit 1
4043fi
4144
@@ -64,7 +67,7 @@ check_utility() {
6467 if [ " $USE_MULTICALL " -eq 1 ]; then
6568 local util_cmd=" $COREUTILS_BIN $util "
6669 else
67- local util_path=" $PROJECT_ROOT /target/release /$util "
70+ local util_path=" $PROJECT_ROOT /target/${PROFILE} /$util "
6871 if [ ! -f " $util_path " ]; then
6972 fail_immediately " $util binary not found at $util_path "
7073 fi
@@ -157,7 +160,7 @@ if [ "$USE_MULTICALL" -eq 1 ]; then
157160else
158161 AVAILABLE_UTILS=" "
159162 for util in rm chmod chown chgrp du mv; do
160- if [ -f " $PROJECT_ROOT /target/release /$util " ]; then
163+ if [ -f " $PROJECT_ROOT /target/${PROFILE} /$util " ]; then
161164 AVAILABLE_UTILS=" $AVAILABLE_UTILS $util "
162165 fi
163166 done
0 commit comments