rust: shellcheck setup hooks

This commit is contained in:
Wolfgang Walther 2024-08-24 23:41:25 +02:00
parent 9220a19a4d
commit d5013e942e
No known key found for this signature in database
GPG Key ID: B39893FA5F65CAE1
4 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,5 @@
# shellcheck shell=bash disable=SC2154,SC2164
cargoBuildHook() {
echo "Executing cargoBuildHook"
@ -7,9 +9,10 @@ cargoBuildHook() {
# separateDebugInfo.
export "CARGO_PROFILE_${cargoBuildType@U}_STRIP"=false
if [ ! -z "${buildAndTestSubdir-}" ]; then
if [ -n "${buildAndTestSubdir-}" ]; then
# ensure the output doesn't end up in the subdirectory
export CARGO_TARGET_DIR="$(pwd)/target"
CARGO_TARGET_DIR="$(pwd)/target"
export CARGO_TARGET_DIR
pushd "${buildAndTestSubdir}"
fi
@ -37,7 +40,7 @@ cargoBuildHook() {
echoCmd 'cargoBuildHook flags' "${flagsArray[@]}"
@setEnv@ cargo build "${flagsArray[@]}"
if [ ! -z "${buildAndTestSubdir-}" ]; then
if [ -n "${buildAndTestSubdir-}" ]; then
popd
fi

View File

@ -1,3 +1,5 @@
# shellcheck shell=bash disable=SC2154,SC2164
cargoCheckHook() {
echo "Executing cargoCheckHook"

View File

@ -1,3 +1,5 @@
# shellcheck shell=bash disable=SC2154,SC2164
cargoNextestHook() {
echo "Executing cargoNextestHook"

View File

@ -1,3 +1,5 @@
# shellcheck shell=bash disable=SC2154,SC2164
maturinBuildHook() {
echo "Executing maturinBuildHook"
@ -6,7 +8,7 @@ maturinBuildHook() {
# Put the wheel to dist/ so that regular Python tooling can find it.
local dist="$PWD/dist"
if [ ! -z "${buildAndTestSubdir-}" ]; then
if [ -n "${buildAndTestSubdir-}" ]; then
pushd "${buildAndTestSubdir}"
fi
@ -25,7 +27,7 @@ maturinBuildHook() {
echoCmd 'maturinBuildHook flags' "${flagsArray[@]}"
@setEnv@ maturin build "${flagsArray[@]}"
if [ ! -z "${buildAndTestSubdir-}" ]; then
if [ -n "${buildAndTestSubdir-}" ]; then
popd
fi