Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions deployments/cli/community/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,18 @@ function spinner() {

function checkLatestRelease(){
echo "Checking for the latest release..." >&2
local latest_release=$(curl -sSL https://api.github.com/repos/$GH_REPO/releases/latest | grep -o '"tag_name": "[^"]*"' | sed 's/"tag_name": "//;s/"//g')
if ! command -v python3 &> /dev/null; then
echo "python3 is required but not installed. Please install Python 3 and try again." >&2
exit 1
fi
local latest_release
latest_release=$(curl -fsSL "https://api.github.com/repos/$GH_REPO/releases/latest" | python3 -c "import sys,json; print(json.load(sys.stdin)['tag_name'])" 2>/dev/null)
if [ -z "$latest_release" ]; then
echo "Failed to check for the latest release. Exiting..." >&2
exit 1
fi

echo $latest_release
echo "$latest_release"
}

function initialize(){
Expand Down
9 changes: 7 additions & 2 deletions deployments/swarm/community/swarm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@ EOF

function checkLatestRelease(){
echo "Checking for the latest release..." >&2
local latest_release=$(curl -s https://api.github.com/repos/$GH_REPO/releases/latest | grep -o '"tag_name": "[^"]*"' | sed 's/"tag_name": "//;s/"//g')
if ! command -v python3 &> /dev/null; then
echo "python3 is required but not installed. Please install Python 3 and try again." >&2
exit 1
fi
local latest_release
latest_release=$(curl -fsSL "https://api.github.com/repos/$GH_REPO/releases/latest" | python3 -c "import sys,json; print(json.load(sys.stdin)['tag_name'])" 2>/dev/null)
if [ -z "$latest_release" ]; then
echo "Failed to check for the latest release. Exiting..." >&2
exit 1
fi

echo $latest_release
echo "$latest_release"
}

# Function to read stack name from env file
Expand Down