1#!/bin/sh
2
3# Script to re-vendor the headers from the `wasm-c-api` proposal.
4
5rev="9d6b93764ac96cdd9db51081c363e09d2d488b4d"
6files="wasm.h wasm.hh"
7
8set -ex
9
10for file in $files; do
11  dst=crates/c-api/include/$file
12  pretty_url=https://github.com/WebAssembly/wasm-c-api/blob/$rev/include/$file
13  url=https://raw.githubusercontent.com/WebAssembly/wasm-c-api/$rev/include/$file
14  cat >$dst <<-EOF
15// Wasmtime-vendored copy of this header file as present in upstream:
16// <$pretty_url>
17//
18// Wasmtime maintainers can update this vendored copy in-tree with the
19// ./ci/vendor-c-api-headers.sh shell script.
20//
21EOF
22  curl $url >> $dst
23done
24