Make copyCargoTargetToOutputHook even more lazy

* Instead of always installing the hook but bailing early based on the
  configuration, we will instead only install the hook if the
  configuration requests it
This commit is contained in:
Ivan Petkov 2021-12-28 18:53:05 -08:00
parent ade4ea7137
commit 2730271710
No known key found for this signature in database
GPG Key ID: BB6F9EFC065832B6

View File

@ -1,10 +1,6 @@
copyCargoTargetToOutput() {
echo "Executing copyCargoTargetToOutput"
if [ "1" != "${doCopyTargetToOutput-}" ]; then
return
fi
export SOURCE_DATE_EPOCH=1
mkdir -p "${target}"
@ -22,4 +18,6 @@ copyCargoTargetToOutput() {
-c target | @zstd@ -o "${target}/target.tar.zst"
}
postInstallHooks+=(copyCargoTargetToOutput)
if [ "1" = "${doCopyTargetToOutput-}" ]; then
postInstallHooks+=(copyCargoTargetToOutput)
fi