aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-01-27 10:37:03 +0300
committerBonfaceKilz2022-01-27 15:25:20 +0300
commit627f86392f082b9a42bd9efeb59e7ee9374932b3 (patch)
tree5e3f2d164ac213bece7d3a9e63e0cc924bb49128 /bin
parentf6490120975eebe879a9d22f6bd741d887ec6ca5 (diff)
downloadgenenetwork2-627f86392f082b9a42bd9efeb59e7ee9374932b3.tar.gz
Fix 'Bad substitution' issue
In posix shell, string indexing is undefined. This commit replaces the string indexing with a more portable implementation.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/genenetwork22
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/genenetwork2 b/bin/genenetwork2
index ce3678e4..7669a89a 100755
--- a/bin/genenetwork2
+++ b/bin/genenetwork2
@@ -59,7 +59,7 @@ else
echo INFO: GN2 is running from a source tree
GIT_HASH=$(git rev-parse HEAD)
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
- export GN_VERSION=$GN2_ID:$(cat $GN2_BASE_DIR/etc/VERSION)-$GIT_BRANCH-${GIT_HASH:0:9}
+ export GN_VERSION="${GN2_ID}:$(cat ${GN2_BASE_DIR}/etc/VERSION)-${GIT_BRANCH}-$(echo ${GIT_HASH} | cut -c1-9)"
fi
echo GN_VERSION=$GN_VERSION