Ensure run.local files are located relative to the

...run file

Prevent erroring if `run` is being executed within a sub-directory, like
`assets`.
This commit is contained in:
Oliver Davies 2024-07-31 01:20:30 +01:00
parent ac8246704e
commit 4e255cd667
8 changed files with 19 additions and 11 deletions

View file

@ -119,7 +119,8 @@ function _run {
{% endif %} {% endif %}
# Include any local tasks. # 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' TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}" time "${@:-help}"

View file

@ -159,7 +159,8 @@ function _run {
} }
# Include any local tasks. # 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' TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}" time "${@:-help}"

View file

@ -35,7 +35,8 @@ function start {
} }
# Include any local tasks. # 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" TIMEFORMAT="Task completed in %3lR"
time "${@:-help}" time "${@:-help}"

View file

@ -25,7 +25,8 @@ function help {
} }
# Include any local tasks. # 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' TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}" time "${@:-help}"

View file

@ -103,12 +103,13 @@ function _run {
--entrypoint "${command}" \ --entrypoint "${command}" \
--no-deps \ --no-deps \
--rm \ --rm \
${TTY} \ "${TTY}" \
"${service}" "${@}" "${service}" "${@}"
} }
# Include any local tasks. # 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' TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}" time "${@:-help}"

View file

@ -103,12 +103,13 @@ function _run {
--entrypoint "${command}" \ --entrypoint "${command}" \
--no-deps \ --no-deps \
--rm \ --rm \
${TTY} \ "${TTY}" \
"${service}" "${@}" "${service}" "${@}"
} }
# Include any local tasks. # 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' TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}" time "${@:-help}"

View file

@ -121,12 +121,13 @@ function _run {
--entrypoint "${command}" \ --entrypoint "${command}" \
--no-deps \ --no-deps \
--rm \ --rm \
${TTY} \ "${TTY}" \
"${service}" "${@}" "${service}" "${@}"
} }
# Include any local tasks. # 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' TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}" time "${@:-help}"

View file

@ -105,7 +105,8 @@ function _run {
} }
# Include any local tasks. # 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' TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}" time "${@:-help}"