diff --git a/bench-bot.sh b/bench-bot.sh index 020793d..c46888b 100755 --- a/bench-bot.sh +++ b/bench-bot.sh @@ -94,20 +94,23 @@ bench_pallet() { fi local weights_dir="./runtime/${runtime_dir}/src/weights" - # translates e.g. "pallet_foo::bar" to "pallet_foo_bar" - local output_file="${pallet//::/_}" + local output_file="" + if [[ $pallet == *"::"* ]]; then + # translates e.g. "pallet_foo::bar" to "pallet_foo_bar" + output_file="${pallet//::/_}.rs" + fi case "$kind" in runtime) args+=( --header=./file_header.txt - --output="${weights_dir}/${output_file}.rs" + --output="${weights_dir}/${output_file}" ) ;; xcm) args+=( --template=./xcm/pallet-xcm-benchmarks/template.hbs - --output="${weights_dir}/xcm/${output_file}.rs" + --output="${weights_dir}/xcm/${output_file}" ) ;; *) @@ -129,20 +132,23 @@ bench_pallet() { --header=./file_header.txt ) - # translates e.g. "pallet_foo::bar" to "pallet_foo_bar" - local output_file="${pallet//::/_}" + local output_file="" + if [[ $pallet == *"::"* ]]; then + # translates e.g. "pallet_foo::bar" to "pallet_foo_bar" + output_file="${pallet//::/_}.rs" + fi case "$kind" in pallet) args+=( - --output="./parachains/runtimes/$chain_type/$runtime/src/weights/${output_file}.rs" + --output="./parachains/runtimes/$chain_type/$runtime/src/weights/${output_file}" ) ;; xcm) mkdir -p "./parachains/runtimes/$chain_type/$runtime/src/weights/xcm" args+=( --template=./templates/xcm-bench-template.hbs - --output="./parachains/runtimes/$chain_type/$runtime/src/weights/xcm/${output_file}.rs" + --output="./parachains/runtimes/$chain_type/$runtime/src/weights/xcm/${output_file}" ) ;; *)