Skip to content

Commit 598e370

Browse files
committed
Fix rewatch bash script in case of no postinstall
- #147
1 parent dd63530 commit 598e370

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

rewatch

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,27 @@
33
# Get the directory of the script to work from.
44
DIR=$(dirname "$0")
55

6-
if [ "$(uname)" = "Darwin" ]; then
7-
# Run the Mac Version
8-
$DIR/rewatch-macos.exe $@
9-
elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]; then
10-
# Run the Linux Version
11-
elif [ "$(expr substr $(uname -m) 1 7)" = "aarch64" ]; then
12-
# Run the Linux ARM64 Version
13-
$DIR/rewatch-linux-arm64.exe $@
14-
else
15-
$DIR/rewatch-linux.exe $@
6+
# Detect platform and architecture
7+
PLATFORM=$(uname -s)
8+
ARCH=$(uname -m)
9+
10+
if [ "$PLATFORM" = "Darwin" ]; then
11+
# macOS
12+
$DIR/rewatch-macos "$@"
13+
elif [ "$PLATFORM" = "Linux" ]; then
14+
# Linux
15+
if [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then
16+
# ARM64 architecture
17+
$DIR/rewatch-linux-arm64 "$@"
18+
else
19+
# Other architectures (x86_64, etc.)
20+
$DIR/rewatch-linux "$@"
1621
fi
22+
elif echo "$PLATFORM" | grep -i "MINGW\|MSYS\|CYGWIN" > /dev/null; then
23+
# Windows (when running in Git Bash, MSYS2, Cygwin, etc.)
24+
$DIR/rewatch.exe "$@"
1725
else
18-
echo "No release available for '$(uname)'"
26+
echo "No release available for '$PLATFORM'"
1927
exit 1
2028
fi
29+

0 commit comments

Comments
 (0)