diff options
| author | Mikhail Romanko <me@blankhex.com> | 2025-07-30 18:52:38 +0300 |
|---|---|---|
| committer | Mikhail Romanko <me@blankhex.com> | 2025-07-30 18:52:38 +0300 |
| commit | 7bd4f122d76cfd14285137e5db4000753ede7958 (patch) | |
| tree | df70e1b1ac83bb8b4580c627eb9322798b5382fc | |
| parent | d0230c3b30f8f753d94377eb25177623fbbcc6d9 (diff) | |
| download | bhlib-7bd4f122d76cfd14285137e5db4000753ede7958.tar.gz | |
Add trailing slash if needed in configure script
| -rwxr-xr-x | configure | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -31,6 +31,12 @@ assign_toggle() { eval "$1=$2" } +add_trailing_slash() { + set -- "$1" "$(printf "%s" "$1" | tail -c 1)" + if [ "$2" = "/" ]; then echo "$1"; + else echo "$1/"; fi +} + # Option parsing for option do case $option in @@ -74,6 +80,11 @@ exit 1 if [ -n "$display_help" ]; then show_help; fi +# Add trailing slash if needed +if [ -n "$source_path" ]; then + source_path=$(add_trailing_slash "$source_path") +fi + # Detect OS and platform, because it wasn't specified os="Unknown" if [ -z "$platform" ]; then |
