Skip to content

Commit b4bb219

Browse files
committed
✨ feat: Improve make-shell bin
1 parent ad3815c commit b4bb219

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

bin/make-shell

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/usr/bin/env bash
2-
# Wrapper used as make SHELL: sources lib/log.sh then runs the recipe.
3-
# So recipes can use run, log_info, etc. without defining RUN in the Makefile.
2+
# Wrapper used as make SHELL: sources all lib/*.sh then runs the recipe.
3+
# So recipes can use run, log_info, distro, etc. from any lib without defining them in the Makefile.
44
[ "$1" = -c ] && shift
55
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
6-
cd "$ROOT" && . ./lib/log.sh && eval "$@"
6+
cd "$ROOT" || exit $?
7+
for f in "$ROOT"/lib/*.sh; do
8+
[ -f "$f" ] && . "$f"
9+
done
10+
eval "$@"
711
exit $?

0 commit comments

Comments
 (0)