Skip to content

Commit bb3ed07

Browse files
committed
Added extract dir in installation script
1 parent 0a7f6ba commit bb3ed07

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

install.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,38 @@ ARCH=$(uname -m)
1313
if [[ "$OS" == "linux" ]]; then
1414
if [[ "$ARCH" == "x86_64" ]]; then
1515
BINARY="learn-regex_Linux_x86_64.tar.gz"
16+
EXTRACT_DIR="learn-regex_Linux_x86_64"
1617
elif [[ "$ARCH" == "aarch64" ]]; then
1718
BINARY="learn-regex_Linux_arm64.tar.gz"
19+
EXTRACT_DIR="learn-regex_Linux_arm64"
1820
elif [[ "$ARCH" == "i386" || "$ARCH" == "i686" ]]; then
1921
BINARY="learn-regex_Linux_i386.tar.gz"
22+
EXTRACT_DIR="learn-regex_Linux_i386"
2023
else
2124
echo "Unsupported architecture: $ARCH"
2225
exit 1
2326
fi
2427
elif [[ "$OS" == "darwin" ]]; then
2528
if [[ "$ARCH" == "x86_64" ]]; then
2629
BINARY="learn-regex_Darwin_x86_64.tar.gz"
30+
EXTRACT_DIR="learn-regex_Darwin_x86_64"
2731
elif [[ "$ARCH" == "arm64" ]]; then
2832
BINARY="learn-regex_Darwin_arm64.tar.gz"
33+
EXTRACT_DIR="learn-regex_Darwin_arm64"
2934
else
3035
echo "Unsupported architecture: $ARCH"
3136
exit 1
3237
fi
3338
elif [[ "$OS" == "mingw32nt" || "$OS" == "cygwin" || "$OS" == "msys" || "$OS" == "windows_nt" ]]; then
3439
if [[ "$ARCH" == "x86_64" ]]; then
3540
BINARY="learn-regex_Windows_x86_64.zip"
41+
EXTRACT_DIR="learn-regex_Windows_x86_64"
3642
elif [[ "$ARCH" == "aarch64" ]]; then
3743
BINARY="learn-regex_Windows_arm64.zip"
44+
EXTRACT_DIR="learn-regex_Windows_arm64"
3845
elif [[ "$ARCH" == "i386" || "$ARCH" == "i686" ]]; then
3946
BINARY="learn-regex_Windows_i386.zip"
47+
EXTRACT_DIR="learn-regex_Windows_i386"
4048
else
4149
echo "Unsupported architecture: $ARCH"
4250
exit 1
@@ -55,11 +63,11 @@ cd "$TMP_DIR"
5563
if [[ "$OS" == "mingw32nt" || "$OS" == "cygwin" || "$OS" == "msys" || "$OS" == "windows_nt" ]]; then
5664
curl -L -o "$BINARY" "$DOWNLOAD_URL"
5765
unzip "$BINARY"
58-
mv learn-regex.exe "$INSTALL_DIR/$BIN_NAME.exe"
66+
mv "$EXTRACT_DIR/learn-regex.exe" "$INSTALL_DIR/$BIN_NAME.exe"
5967
else
6068
curl -L -o "$BINARY" "$DOWNLOAD_URL"
6169
tar xzf "$BINARY"
62-
mv learn-regex "$INSTALL_DIR/$BIN_NAME"
70+
mv "$EXTRACT_DIR/learn-regex" "$INSTALL_DIR/$BIN_NAME"
6371
chmod +x "$INSTALL_DIR/$BIN_NAME"
6472
fi
6573

0 commit comments

Comments
 (0)