#!/bin/sh

set -e
set -x

cd `dirname $0`

if [ ! -f "../../scripts/amalgamation.py" ]; then
	echo "Could not find the amalgamation build script"
	exit 1
fi

(cd ../.. && python3 scripts/amalgamation.py --extended --source=tools/nodejs/src/duckdb.cpp --header=tools/nodejs/src/duckdb.hpp)
(cd ../.. && python3 scripts/parquet_amalgamation.py && cp src/amalgamation/parquet-amalgamation* tools/nodejs/src/)
