mirror of
https://github.com/lukasbestle/projectr.git
synced 2026-10-11 23:10:19 +02:00
Support for .postlink.sh hook script
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user