Support for .postlink.sh hook script

This commit is contained in:
2020-05-30 16:09:03 +02:00
parent fe51225253
commit 22ada23b8b
3 changed files with 60 additions and 4 deletions
+16
View File
@@ -44,3 +44,19 @@ else
echo -e " => \033[31mSomething went wrong.\033[0m" >&2
exit 1
fi
# Run post-link script if existing
if [[ -x "$project/current/.postlink.sh" ]]; then
# Set the working directory to the destination
oldpwd="$(pwd)"
cd "$project/current"
echo -e "\033[1mRunning post-link script...\033[0m"
if ! $project/current/.postlink.sh; then
echo -e " => \033[31mSomething went wrong.\033[0m" >&2
exit 1
fi
echo -e " => \033[32mSuccess.\033[0m"
cd "$oldpwd"
fi