24 lines
638 B
Bash
Executable File
24 lines
638 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Write kernel/build/kernel.json with the absolute host entrypoint digest.
|
|
set -euo pipefail
|
|
here="$(cd "$(dirname "$0")" && pwd)"
|
|
out="$here/build"
|
|
mkdir -p "$out"
|
|
chmod +x "$here/mocklang"
|
|
if command -v sha256sum >/dev/null 2>&1; then
|
|
hash="$(sha256sum "$here/mocklang" | cut -d' ' -f1)"
|
|
else
|
|
hash="$(shasum -a 256 "$here/mocklang" | cut -d' ' -f1)"
|
|
fi
|
|
cat > "$out/kernel.json" <<JSON
|
|
{
|
|
"provider_id": "mocklang-provider",
|
|
"languages": ["mocklang"],
|
|
"wire_version": 1,
|
|
"entrypoint": "$here/mocklang",
|
|
"permissions_requested": [],
|
|
"digest": "$hash"
|
|
}
|
|
JSON
|
|
echo "built $out/kernel.json (digest $hash)"
|