cargo/hooks: allow hooks to be disabled

This commit is contained in:
Jonathan Ringer 2021-02-28 17:18:12 -08:00 committed by Frederik Rietdijk
parent e83d926f21
commit 042adf08d1
4 changed files with 8 additions and 4 deletions

View file

@ -36,4 +36,6 @@ cargoBuildHook() {
echo "Finished cargoBuildHook"
}
buildPhase=cargoBuildHook
if [ -z "${dontCargoBuild-}" ] && [ -z "${buildPhase-}" ]; then
buildPhase=cargoBuildHook
fi

View file

@ -41,6 +41,6 @@ cargoCheckHook() {
runHook postCheck
}
if [ -z "${checkPhase-}" ]; then
if [ -z "${dontCargoCheck-}" ] && [ -z "${checkPhase-}" ]; then
checkPhase=cargoCheckHook
fi

View file

@ -43,7 +43,7 @@ cargoInstallHook() {
}
if [ -z "${installPhase-}" ]; then
if [ -z "${dontCargoInstall-}" ] && [ -z "${installPhase-}" ]; then
installPhase=cargoInstallHook
postBuildHooks+=(cargoInstallPostBuildHook)
fi

View file

@ -77,7 +77,9 @@ cargoSetupPostPatchHook() {
echo "Finished cargoSetupPostPatchHook"
}
postUnpackHooks+=(cargoSetupPostUnpackHook)
if [ -z "${dontCargoSetupPostUnpack-}" ]; then
postUnpackHooks+=(cargoSetupPostUnpackHook)
fi
if [ -z ${cargoVendorDir-} ]; then
postPatchHooks+=(cargoSetupPostPatchHook)