Skip to content

Commit

Permalink
fix script , use wget or curl
Browse files Browse the repository at this point in the history
Signed-off-by: hunnywar <[email protected]>
  • Loading branch information
hunnywar committed Jan 8, 2025
1 parent f6a710b commit cfa597f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion hack/get-ttyd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,18 @@ else
exit 1
fi

# Check for wget or curl and use the available tool to download the binary
if command -v wget &>/dev/null; then
downloader="wget"
elif command -v curl &>/dev/null; then
downloader="curl -L"
else
echo "Neither wget nor curl is available. Please install one of them."
exit 1
fi

# Download and set up ttyd
wget https://github.com/$RELEASE_ORG/ttyd/releases/download/$RELEASE_TAG/ttyd.$arch -O $HOME/ttyd-$arch
$downloader https://github.com/$RELEASE_ORG/ttyd/releases/download/$RELEASE_TAG/ttyd.$arch -O $HOME/ttyd-$arch
chmod +x $HOME/ttyd-$arch

# Move ttyd to installation directory
Expand Down

0 comments on commit cfa597f

Please sign in to comment.