dartHooks.dartInstallHook: Allow disabling cache installation independently

This commit is contained in:
hacker1024 2024-01-18 10:15:35 +11:00
parent 196a0a5b2d
commit b43ee05f4e

View file

@ -19,15 +19,25 @@ dartInstallHook() {
fi
done < <(_getDartEntryPoints)
# Install the package_config.json file.
mkdir -p "$pubcache"
cp .dart_tool/package_config.json "$pubcache/package_config.json"
runHook postInstall
echo "Finished dartInstallHook"
}
dartInstallCacheHook() {
echo "Executing dartInstallCacheHook"
# Install the package_config.json file.
mkdir -p "$pubcache"
cp .dart_tool/package_config.json "$pubcache/package_config.json"
echo "Finished dartInstallCacheHook"
}
if [ -z "${dontDartInstall-}" ] && [ -z "${installPhase-}" ]; then
installPhase=dartInstallHook
fi
if [ -z "${dontDartInstallCache-}" ]; then
postInstallHooks+=(dartInstallCacheHook)
fi