aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Romanko <me@blankhex.com>2025-07-30 18:52:38 +0300
committerMikhail Romanko <me@blankhex.com>2025-07-30 18:52:38 +0300
commit7bd4f122d76cfd14285137e5db4000753ede7958 (patch)
treedf70e1b1ac83bb8b4580c627eb9322798b5382fc
parentd0230c3b30f8f753d94377eb25177623fbbcc6d9 (diff)
downloadbhlib-7bd4f122d76cfd14285137e5db4000753ede7958.tar.gz
Add trailing slash if needed in configure script
-rwxr-xr-xconfigure11
1 files changed, 11 insertions, 0 deletions
diff --git a/configure b/configure
index 03b20d7..3f9aa77 100755
--- a/configure
+++ b/configure
@@ -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