@@ -94,20 +94,23 @@ bench_pallet() {
9494 fi
9595 local weights_dir=" ./runtime/${runtime_dir} /src/weights"
9696
97- # translates e.g. "pallet_foo::bar" to "pallet_foo_bar"
98- local output_file=" ${pallet//::/ _} "
97+ local output_file=" "
98+ if [[ $pallet == * " ::" * ]]; then
99+ # translates e.g. "pallet_foo::bar" to "pallet_foo_bar"
100+ output_file=" ${pallet//::/ _} .rs"
101+ fi
99102
100103 case " $kind " in
101104 runtime)
102105 args+=(
103106 --header=./file_header.txt
104- --output=" ${weights_dir} /${output_file} .rs "
107+ --output=" ${weights_dir} /${output_file} "
105108 )
106109 ;;
107110 xcm)
108111 args+=(
109112 --template=./xcm/pallet-xcm-benchmarks/template.hbs
110- --output=" ${weights_dir} /xcm/${output_file} .rs "
113+ --output=" ${weights_dir} /xcm/${output_file} "
111114 )
112115 ;;
113116 * )
@@ -129,20 +132,23 @@ bench_pallet() {
129132 --header=./file_header.txt
130133 )
131134
132- # translates e.g. "pallet_foo::bar" to "pallet_foo_bar"
133- local output_file=" ${pallet//::/ _} "
135+ local output_file=" "
136+ if [[ $pallet == * " ::" * ]]; then
137+ # translates e.g. "pallet_foo::bar" to "pallet_foo_bar"
138+ output_file=" ${pallet//::/ _} .rs"
139+ fi
134140
135141 case " $kind " in
136142 pallet)
137143 args+=(
138- --output=" ./parachains/runtimes/$chain_type /$runtime /src/weights/${output_file} .rs "
144+ --output=" ./parachains/runtimes/$chain_type /$runtime /src/weights/${output_file} "
139145 )
140146 ;;
141147 xcm)
142148 mkdir -p " ./parachains/runtimes/$chain_type /$runtime /src/weights/xcm"
143149 args+=(
144150 --template=./templates/xcm-bench-template.hbs
145- --output=" ./parachains/runtimes/$chain_type /$runtime /src/weights/xcm/${output_file} .rs "
151+ --output=" ./parachains/runtimes/$chain_type /$runtime /src/weights/xcm/${output_file} "
146152 )
147153 ;;
148154 * )
0 commit comments