Skip to content
Merged
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
34 changes: 34 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"features": {
"ghcr.io/devcontainers/features/copilot-cli": {
"version": "1.1.2",
"resolved": "ghcr.io/devcontainers/features/copilot-cli@sha256:757c6c2899dc902c44a9f6164c1f7392832ced13c6bb632d8d60a880f2e92456",
"integrity": "sha256:757c6c2899dc902c44a9f6164c1f7392832ced13c6bb632d8d60a880f2e92456"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "2.16.1",
"resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:ce078b7bf7d9ef3bcb9813b32103795d8d72172446890b64772cbe1dec6baafd",
"integrity": "sha256:ce078b7bf7d9ef3bcb9813b32103795d8d72172446890b64772cbe1dec6baafd"
},
"ghcr.io/devcontainers/features/github-cli:latest": {
"version": "1.1.0",
"resolved": "ghcr.io/devcontainers/features/github-cli@sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671",
"integrity": "sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671"
},
"ghcr.io/jsburckhardt/devcontainer-features/tmux:1": {
"version": "1.0.0",
"resolved": "ghcr.io/jsburckhardt/devcontainer-features/tmux@sha256:f75eb8e2c8f9ea30980729d5303b96071a4f17ad3d5eccab0c75efc5d8271498",
"integrity": "sha256:f75eb8e2c8f9ea30980729d5303b96071a4f17ad3d5eccab0c75efc5d8271498"
},
"ghcr.io/jsburckhardt/devcontainer-features/yazi:1.0.1": {
"version": "1.0.1",
"resolved": "ghcr.io/jsburckhardt/devcontainer-features/yazi@sha256:35383727c0eee36d02f89ee7e805cbd94dfabe6c86d24c2e07e33b1a678e098a",
"integrity": "sha256:35383727c0eee36d02f89ee7e805cbd94dfabe6c86d24c2e07e33b1a678e098a"
},
"ghcr.io/stuartleeks/dev-container-features/shell-history:0": {
"version": "0.0.6",
"resolved": "ghcr.io/stuartleeks/dev-container-features/shell-history@sha256:f266af2d093e0611921ccf510046e53affeccb353405ee05d2b91fcc4f69c1c9",
"integrity": "sha256:f266af2d093e0611921ccf510046e53affeccb353405ee05d2b91fcc4f69c1c9"
}
}
}
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,15 @@ Running `hurl --version` inside the built container will print the version of hu
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/jsburckhardt/devcontainer-features/fzf:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/lazygit:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/ripgrep:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/fd:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/rtk:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/zoxide:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/hyperfine:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/glow:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/fx:1": {}
"ghcr.io/jsburckhardt/devcontainer-features/fzf:1": {},
"ghcr.io/jsburckhardt/devcontainer-features/lazygit:1": {},
"ghcr.io/jsburckhardt/devcontainer-features/ripgrep:1": {},
"ghcr.io/jsburckhardt/devcontainer-features/fd:1": {},
"ghcr.io/jsburckhardt/devcontainer-features/rtk:1": {},
"ghcr.io/jsburckhardt/devcontainer-features/zoxide:1": {},
"ghcr.io/jsburckhardt/devcontainer-features/hyperfine:1": {},
"ghcr.io/jsburckhardt/devcontainer-features/glow:1": {},
"ghcr.io/jsburckhardt/devcontainer-features/fx:1": {},
"ghcr.io/jsburckhardt/devcontainer-features/hurl:1": {}
}
}
Expand Down
42 changes: 22 additions & 20 deletions src/hurl/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,26 @@ check_packages() {
fi
}

# Make sure we have curl, jq, and hurl runtime dependencies
check_packages curl jq ca-certificates libxml2 libcurl4 libssl3
# Make sure we have curl and jq
check_packages curl jq ca-certificates

# Install libxml2 runtime dependency
# On newer Ubuntu (25.04+), the package is libxml2-16 and provides libxml2.so.16
# but hurl is linked against libxml2.so.2, so we need a compatibility symlink
if [ "$(find /var/lib/apt/lists/* 2>/dev/null | wc -l)" = "0" ]; then
apt-get update -y
fi
if apt-cache show libxml2 2>&1 | grep -q "^Version:"; then
check_packages libxml2
else
check_packages libxml2-16
# Create compatibility symlink for binaries expecting libxml2.so.2
LIBXML2_SO=$(find /usr/lib -name "libxml2.so.*" ! -name "*.so.*.*" | head -1)
if [ -n "$LIBXML2_SO" ] && [ ! -e "$(dirname "$LIBXML2_SO")/libxml2.so.2" ]; then
ln -s "$LIBXML2_SO" "$(dirname "$LIBXML2_SO")/libxml2.so.2"
ldconfig
fi
fi

# Function to get the latest version from GitHub API
get_latest_version() {
Expand All @@ -38,17 +56,14 @@ get_latest_version() {

# Check if a version is passed as an argument
if [ -z "$HURL_VERSION" ] || [ "$HURL_VERSION" == "latest" ]; then
# No version provided, get the latest version
HURL_VERSION=$(get_latest_version)
echo "No version provided or 'latest' specified, installing the latest version: $HURL_VERSION"
else
echo "Installing version from environment variable: $HURL_VERSION"
fi

# Determine the OS and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)

case "$ARCH" in
x86_64)
ARCH="x86_64"
Expand All @@ -62,21 +77,8 @@ case "$ARCH" in
;;
esac

case "$OS" in
linux)
OS="unknown-linux-gnu"
;;
darwin)
OS="apple-darwin"
;;
*)
echo "Unsupported OS: $OS"
exit 1
;;
esac

# Construct the download URL
DOWNLOAD_URL="https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/${HURL_VERSION}/hurl-${HURL_VERSION}-${ARCH}-${OS}.tar.gz"
DOWNLOAD_URL="https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/${HURL_VERSION}/hurl-${HURL_VERSION}-${ARCH}-unknown-linux-gnu.tar.gz"

# Create a temporary directory for the download
TMP_DIR=$(mktemp -d)
Expand All @@ -102,7 +104,7 @@ mv "${EXTRACTED_DIR}/bin/hurl" /usr/local/bin/
mv "${EXTRACTED_DIR}/bin/hurlfmt" /usr/local/bin/

# Cleanup
cd - || exit
cd / || exit
rm -rf "$TMP_DIR"

# Clean up
Expand Down
Loading