From 9ebf81fc8d2e36874e627c52173376fb65dfa7bc Mon Sep 17 00:00:00 2001 From: h Date: Wed, 24 Jun 2026 18:46:40 +0200 Subject: [PATCH] Run a user-provided post-install script if present --- {{ cookiecutter.format }}/installer/scripts/postinstall | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/{{ cookiecutter.format }}/installer/scripts/postinstall b/{{ cookiecutter.format }}/installer/scripts/postinstall index f6c5280..c2a7758 100755 --- a/{{ cookiecutter.format }}/installer/scripts/postinstall +++ b/{{ cookiecutter.format }}/installer/scripts/postinstall @@ -1,6 +1,6 @@ #!/bin/sh echo "Post installation process started" - +{% if cookiecutter.console_app %} if [ ! -d "/usr/local/bin" ]; then echo "Creating /usr/local/bin directory" mkdir -p /usr/local/bin @@ -8,5 +8,11 @@ fi echo "Install binary symlink" ln -si "/Library/{{ cookiecutter.formal_name }}/{{ cookiecutter.formal_name }}.app/Contents/MacOS/{{ cookiecutter.formal_name }}" /usr/local/bin/{{ cookiecutter.app_name }} +{% endif %} +# Run the user-provided post-install script, if one was included. +if [ -e "$(dirname "$0")/_postinstall" ]; then + echo "Running post-install script" + "$(dirname "$0")/_postinstall" +fi echo "Post installation process finished"