Skip to content

Commit

Permalink
enhance installer for bash
Browse files Browse the repository at this point in the history
  • Loading branch information
kerolloz committed Sep 23, 2024
1 parent 219f2bc commit 65b60f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="https://github.com/user-attachments/assets/bddae006-9533-43c1-b303-6f6de4b6de04" alt="Mongogrator" />
<img src="https://github.com/user-attachments/assets/103be6a4-d02c-473a-b95b-39fd6a84d8a8" alt="Mongogrator" />
</p>

Mongogrator is a very fast database migration CLI for MongoDB. Its purpose is to easily create and run migrations for development and production stages
Expand Down
14 changes: 2 additions & 12 deletions mongogrator-installer.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Variables
VERSION="v1.0.0" # Replace with the latest version if necessary
VERSION="v1.0.2" # Replace with the latest version if necessary
BINARY_NAME="mongogrator"

# Detect platform and architecture
Expand Down Expand Up @@ -39,10 +39,6 @@ Darwin)
esac
FILE_EXT=".tar.gz"
;;
CYGWIN* | MINGW32* | MSYS* | MINGW*)
PLATFORM="windows"
FILE_EXT=".zip"
;;
*)
echo "Unsupported OS: $OS"
exit 1
Expand All @@ -54,7 +50,7 @@ DOWNLOAD_URL="https://github.com/tepinly/mongogrator/releases/download/${VERSION

# Download the release using curl
echo "Downloading Mongogrator ${VERSION} for ${PLATFORM}..."
curl -L -o ${BINARY_NAME}${FILE_EXT} ${DOWNLOAD_URL}
curl -L --progress-bar -o ${BINARY_NAME}${FILE_EXT} ${DOWNLOAD_URL}

# Check if download was successful
if [ $? -ne 0 ]; then
Expand All @@ -77,12 +73,6 @@ if [[ $FILE_EXT == ".tar.gz" ]]; then
mv ${BINARY_NAME}-${PLATFORM} ${BINARY_NAME}
sudo mv ${BINARY_NAME} /usr/local/bin/
fi
elif [[ $FILE_EXT == ".zip" ]]; then
echo "Extracting ${BINARY_NAME}${FILE_EXT}..."
unzip ${BINARY_NAME}${FILE_EXT} -d ${BINARY_NAME}

# Move the Windows binary
sudo mv ${BINARY_NAME}/${BINARY_NAME}.exe /usr/local/bin/${BINARY_NAME}.exe
fi

# Ensure /usr/local/bin is in the PATH (for Linux and macOS)
Expand Down

0 comments on commit 65b60f5

Please sign in to comment.