Files
bun.sh/scripts/download-webkit.sh
dave caruso 3b25c8637b dx: Fix setup script and contributing docs (#6752)
* Updated Dependencies Script

* demo

* fix submodule hell!!!

* lol

* attmept 2

* install nasm in ci

* setup sh 1

* yeah

* better zlib building

* codegen stuff

* attempt 2 at bun codegen ci

* o

* deps improvements

* generaet part of compile-cpp-only.ps1

* restore these

* good enough for Unix

* remove libuv submodule lol

* pass over docs
2023-10-28 04:46:56 -07:00

58 lines
1.1 KiB
Bash

#!/bin/bash
set -e
OUTDIR="$1"
TAG="$2"
PKG="$3"
if [ -z "$OUTDIR" ]; then
echo "Missing outdir"
exit 1
fi
if [ -z "$TAG" ]; then
echo "Missing tag"
exit 1
fi
if [ -z "$PKG" ]; then
echo "Missing package"
exit 1
fi
mkdir -p "$OUTDIR"
url="https://github.com/oven-sh/WebKit/releases/download/autobuild-$TAG/$PKG.tar.gz"
tar_dir="$(dirname "$0")/../.webkit-cache"
tar="$tar_dir/$PKG-$TAG.tar.gz"
mkdir -p "$tar_dir"
# TODO: Remove this block, future builds may not include a package.json
if [ -f "$OUTDIR/package.json" ]; then
read_version=$(grep -o '"version": "[^"]*"' "$OUTDIR/package.json" | sed 's/"version": "\(.*\)"/\1/' 2>/dev/null)
if [ "$read_version" == "0.0.1-$TAG" ]; then
echo "$TAG" > "$OUTDIR/.tag"
exit 0
fi
fi
if [ -f "$OUTDIR/.tag" ]; then
read_tag="$(cat "$OUTDIR/.tag")"
if [ "$read_tag" == "$TAG" ]; then
exit 0
fi
fi
rm -rf "$OUTDIR"
if [ ! -f "$tar" ]; then
echo "-- Downloading WebKit"
if ! curl -o "$tar" -L "$url"; then
echo "Failed to download $url"
exit 1
fi
fi
tar -xzf "$tar" -C "$(dirname "$OUTDIR")"
echo "$TAG" > "$OUTDIR/.tag"