diff --git a/templates/fractal/run.twig b/templates/fractal/run.twig index 7c240b4..48e55a8 100755 --- a/templates/fractal/run.twig +++ b/templates/fractal/run.twig @@ -119,7 +119,8 @@ function _run { {% endif %} # Include any local tasks. -[[ -e run.local ]] && source run.local +# https://stackoverflow.com/a/6659698 +[[ -e "${BASH_SOURCE%/*}/run.local" ]] && source "${BASH_SOURCE%/*}/run.local" TIMEFORMAT=$'\nTask completed in %3lR' time "${@:-help}" diff --git a/templates/php/drupal/run.twig b/templates/php/drupal/run.twig index c083d7b..539edca 100755 --- a/templates/php/drupal/run.twig +++ b/templates/php/drupal/run.twig @@ -159,7 +159,8 @@ function _run { } # Include any local tasks. -[[ -e run.local ]] && source run.local +# https://stackoverflow.com/a/6659698 +[[ -e "${BASH_SOURCE%/*}/run.local" ]] && source "${BASH_SOURCE%/*}/run.local" TIMEFORMAT=$'\nTask completed in %3lR' time "${@:-help}" diff --git a/templates/php/sculpin/run.twig b/templates/php/sculpin/run.twig index 387345d..482cd72 100755 --- a/templates/php/sculpin/run.twig +++ b/templates/php/sculpin/run.twig @@ -35,7 +35,8 @@ function start { } # Include any local tasks. -[[ -e run.local ]] && source run.local +# https://stackoverflow.com/a/6659698 +[[ -e "${BASH_SOURCE%/*}/run.local" ]] && source "${BASH_SOURCE%/*}/run.local" TIMEFORMAT="Task completed in %3lR" time "${@:-help}" diff --git a/templates/terraform/run.twig b/templates/terraform/run.twig index b20aa06..8bbe05f 100755 --- a/templates/terraform/run.twig +++ b/templates/terraform/run.twig @@ -25,7 +25,8 @@ function help { } # Include any local tasks. -[[ -e run.local ]] && source run.local +# https://stackoverflow.com/a/6659698 +[[ -e "${BASH_SOURCE%/*}/run.local" ]] && source "${BASH_SOURCE%/*}/run.local" TIMEFORMAT=$'\nTask completed in %3lR' time "${@:-help}" diff --git a/tests/snapshots/output/drupal-commerce-kickstart/run b/tests/snapshots/output/drupal-commerce-kickstart/run index da6a3ee..59143c9 100755 --- a/tests/snapshots/output/drupal-commerce-kickstart/run +++ b/tests/snapshots/output/drupal-commerce-kickstart/run @@ -103,12 +103,13 @@ function _run { --entrypoint "${command}" \ --no-deps \ --rm \ - ${TTY} \ + "${TTY}" \ "${service}" "${@}" } # Include any local tasks. -[[ -e run.local ]] && source run.local +# https://stackoverflow.com/a/6659698 +[[ -e "${BASH_SOURCE%/*}/run.local" ]] && source "${BASH_SOURCE%/*}/run.local" TIMEFORMAT=$'\nTask completed in %3lR' time "${@:-help}" diff --git a/tests/snapshots/output/drupal-localgov/run b/tests/snapshots/output/drupal-localgov/run index da6a3ee..59143c9 100755 --- a/tests/snapshots/output/drupal-localgov/run +++ b/tests/snapshots/output/drupal-localgov/run @@ -103,12 +103,13 @@ function _run { --entrypoint "${command}" \ --no-deps \ --rm \ - ${TTY} \ + "${TTY}" \ "${service}" "${@}" } # Include any local tasks. -[[ -e run.local ]] && source run.local +# https://stackoverflow.com/a/6659698 +[[ -e "${BASH_SOURCE%/*}/run.local" ]] && source "${BASH_SOURCE%/*}/run.local" TIMEFORMAT=$'\nTask completed in %3lR' time "${@:-help}" diff --git a/tests/snapshots/output/drupal/run b/tests/snapshots/output/drupal/run index 4f786ac..708c254 100755 --- a/tests/snapshots/output/drupal/run +++ b/tests/snapshots/output/drupal/run @@ -121,12 +121,13 @@ function _run { --entrypoint "${command}" \ --no-deps \ --rm \ - ${TTY} \ + "${TTY}" \ "${service}" "${@}" } # Include any local tasks. -[[ -e run.local ]] && source run.local +# https://stackoverflow.com/a/6659698 +[[ -e "${BASH_SOURCE%/*}/run.local" ]] && source "${BASH_SOURCE%/*}/run.local" TIMEFORMAT=$'\nTask completed in %3lR' time "${@:-help}" diff --git a/tests/snapshots/output/fractal/run b/tests/snapshots/output/fractal/run index 3d4b32d..3880ebb 100755 --- a/tests/snapshots/output/fractal/run +++ b/tests/snapshots/output/fractal/run @@ -105,7 +105,8 @@ function _run { } # Include any local tasks. -[[ -e run.local ]] && source run.local +# https://stackoverflow.com/a/6659698 +[[ -e "${BASH_SOURCE%/*}/run.local" ]] && source "${BASH_SOURCE%/*}/run.local" TIMEFORMAT=$'\nTask completed in %3lR' time "${@:-help}"