Gateway: link hasown for form-data

- add hasown symlink workaround for form-data in pnpm layout
- include docs/reference templates in install output

Tests: not run (CI)
This commit is contained in:
DJTBOT
2026-02-02 18:20:29 +01:00
parent ad51e0fe02
commit d9bf68ad36
+21
View File
@@ -7,6 +7,11 @@ if [ -d extensions ]; then
cp -r extensions "$out/lib/openclaw/"
fi
if [ -d docs/reference/templates ]; then
mkdir -p "$out/lib/openclaw/docs/reference"
cp -r docs/reference/templates "$out/lib/openclaw/docs/reference/"
fi
if [ -z "${STDENV_SETUP:-}" ]; then
echo "STDENV_SETUP is not set" >&2
exit 1
@@ -59,5 +64,21 @@ if [ -n "$combined_stream_src" ]; then
fi
fi
# Work around missing hasown dependency for form-data in pnpm layout.
hasown_src="$(find "$out/lib/openclaw/node_modules/.pnpm" -path "*/hasown@*/node_modules/hasown" -print | head -n 1)"
if [ -n "$hasown_src" ]; then
if [ ! -e "$out/lib/openclaw/node_modules/hasown" ]; then
ln -s "$hasown_src" "$out/lib/openclaw/node_modules/hasown"
fi
if [ -n "$form_data_pkgs" ]; then
for pkg in $form_data_pkgs; do
if [ ! -e "$pkg/node_modules/hasown" ]; then
mkdir -p "$pkg/node_modules"
ln -s "$hasown_src" "$pkg/node_modules/hasown"
fi
done
fi
fi
bash -e -c '. "$STDENV_SETUP"; makeWrapper "$NODE_BIN" "$out/bin/openclaw" --add-flags "$out/lib/openclaw/dist/index.js" --set-default OPENCLAW_NIX_MODE "1" --set-default MOLTBOT_NIX_MODE "1" --set-default CLAWDBOT_NIX_MODE "1"'
ln -s "$out/bin/openclaw" "$out/bin/moltbot"