Skip to content

Commit 5f6a185

Browse files
committed
Switch to the same directory as the executing script.
1 parent 7c8d391 commit 5f6a185

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

bump_client.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/env bash
22

3+
4+
# http://stackoverflow.com/a/246128/312785
5+
path="${BASH_SOURCE[0]}"
6+
while [ -h "$path" ] ; do
7+
dir="$(cd -P "$(dirname "$path")" && pwd)"
8+
path="$(readlink "$path")"
9+
[[ $path == /* ]] || path="$dir/$path"
10+
done
11+
dir="$(cd -P "$(dirname "$path")" && pwd)"
12+
13+
314
# replaces the version token and writes it back over itself
415
FILE=dist/client.js
516
sed -e 's/@@REACTOTRON_VERSION@@/'"$VERSION"'/g' $FILE > $FILE.tmp && mv $FILE.tmp $FILE

0 commit comments

Comments
 (0)