Files
tools/scripts/prepare-package-json.sh
2025-08-16 14:17:46 -04:00

17 lines
470 B
Bash
Executable File

#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
distDirectory=${DIST_DIRECTORY:-"dist"}
packageJsonPath=${PACKAGE_JSON_PATH:-"package.json"}
if [ ! -d "${distDirectory}" ]; then
echo "Unable to prepare package.json, [${distDirectory}] not found"
exit $LINENO
fi
echo "Preparing [package.json] to [${distDirectory}]"
jq '{name, version, author, type, types, exports, files, publishConfig}' "${packageJsonPath}" > "${distDirectory}/package.json"