Skip to content

Commit fb43060

Browse files
authored
fix(install.sh): remove bashism (#11)
Make the install.sh POSIX compliant and remove reference to syntax only available in bash and are not backward compatible with POSIX sh
1 parent b3bfa1a commit fb43060

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

install.sh

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

33
set -eu
44

@@ -56,7 +56,7 @@ detect_platform() {
5656
select_archive_format() {
5757
PLATFORM_ARCH=$1
5858

59-
if [[ "$PLATFORM_ARCH" == windows-* ]]; then
59+
if [ "$PLATFORM_ARCH" = windows-* ]; then
6060
echo "zip"
6161
else
6262
if command -v tar >/dev/null 2>&1; then
@@ -98,9 +98,9 @@ main() {
9898

9999
# Extract the archive
100100
echo "Extracting $BINARY_NAME..."
101-
if [ "$FILE_EXT" == "zip" ]; then
101+
if [ "$FILE_EXT" = "zip" ]; then
102102
unzip -d "$TMP_DIR" "$ARCHIVE_PATH"
103-
elif [ "$FILE_EXT" == "tar.gz" ]; then
103+
elif [ "$FILE_EXT" = "tar.gz" ]; then
104104
tar -xzf "$ARCHIVE_PATH" -C "$TMP_DIR"
105105
else
106106
echo "Unsupported file extension: $FILE_EXT"
@@ -120,7 +120,7 @@ main() {
120120
mv "$BINARY_PATH" "$INSTALL_DIR/$BINARY_NAME.exe"
121121
else
122122
sudo su <<EOF
123-
[[ $(uname -s) == "Linux" ]] && setcap cap_net_admin=eip $BINARY_PATH
123+
[ $(uname -s) = "Linux" ] && setcap cap_net_admin=eip $BINARY_PATH
124124
mv "$BINARY_PATH" "$INSTALL_DIR/$BINARY_NAME"
125125
EOF
126126
fi

0 commit comments

Comments
 (0)