Skip to content

Commit 5a63706

Browse files
author
Daniel Ruthardt
authored
✨ Pass through all arguments to Bash (#13)
* 🎨 Replace tab with spaces Signed-off-by: Daniel Ruthardt <druthardt@linuxfoundation.org> * ✨ Forward arguments to executed script Signed-off-by: Daniel Ruthardt <druthardt@linuxfoundation.org> --------- Signed-off-by: Daniel Ruthardt <druthardt@linuxfoundation.org>
1 parent 4a033a9 commit 5a63706

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

bashp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22
set -eo pipefail
33

4-
bashpc "${1:-/dev/stdin}" | bash
4+
bashpc "${1:-/dev/stdin}" | bash -s "$@"

bashpc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eo pipefail
44
script=${1:-/dev/stdin}
55
include_dir="$(dirname "$script")/libs"
66

7-
mkdir -p "$include_dir" || include_dir=$(mktemp -d)
7+
mkdir -p "$include_dir" 2>/dev/null || include_dir=$(mktemp -d)
88

99
INCLUDE_DIR="$include_dir" \
1010
bashpp "$script" | sed '1s,^#!.*$,#!/usr/bin/env bash,'

bashpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function preprocess() {
143143
*::*)
144144
local include
145145
grep -Eo '[a-zA-Z0-9_]+::[a-zA-Z0-9_]+' <<< "$line" |
146-
while read include; do include_once ${include//::/\/}; done
146+
while read include; do include_once ${include//::/\/}; done
147147
echo "$line"
148148
;;
149149
"#include "*)

0 commit comments

Comments
 (0)