#!/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"