Skip to content

Commit 9a40955

Browse files
adamanciniclaude
andcommitted
fix: improve Replicated CLI download URL extraction in utils.yml
- Separate URL extraction into variable for better error handling - Add validation to ensure download URL is found before attempting download - Fix curl command that was failing with "no URL specified" error - Improve error messages for debugging download issues 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 1f74672 commit 9a40955

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

applications/wg-easy/taskfiles/utils.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,31 @@ tasks:
3838
# Download and install based on OS
3939
if [ "$OS" = "linux" ]; then
4040
echo "Downloading Replicated CLI for Linux..."
41-
curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
41+
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
4242
| grep "browser_download_url.*linux_${ARCH}.tar.gz" \
43-
| cut -d '"' -f 4 \
44-
| xargs curl -L -o replicated.tar.gz
43+
| cut -d '"' -f 4)
4544
45+
if [ -z "$DOWNLOAD_URL" ]; then
46+
echo "Error: Could not find download URL for linux_${ARCH}.tar.gz"
47+
exit 1
48+
fi
49+
50+
curl -L -o replicated.tar.gz "$DOWNLOAD_URL"
4651
tar xzf replicated.tar.gz
4752
sudo mv replicated /usr/local/bin/replicated
4853
4954
elif [ "$OS" = "darwin" ]; then
5055
echo "Downloading Replicated CLI for macOS..."
51-
curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
56+
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
5257
| grep "browser_download_url.*darwin_${ARCH}.tar.gz" \
53-
| cut -d '"' -f 4 \
54-
| xargs curl -L -o replicated.tar.gz
58+
| cut -d '"' -f 4)
59+
60+
if [ -z "$DOWNLOAD_URL" ]; then
61+
echo "Error: Could not find download URL for darwin_${ARCH}.tar.gz"
62+
exit 1
63+
fi
5564
65+
curl -L -o replicated.tar.gz "$DOWNLOAD_URL"
5666
tar xzf replicated.tar.gz
5767
sudo mv replicated /usr/local/bin/replicated
5868

0 commit comments

Comments
 (0)