Node.js: used distinct placeholder for version in "package.json".

This makes the "sed" instruction simpler and more portable, as the previous
variant didn't work well on BSD systems due to the "\s" metacharacter.

Thanks to Sergey A. Osokin <osa@FreeBSD.org.ru> for spotting this issue.

Also, this should prevent accidentally creating a version 1.0.0 package.
This commit is contained in:
Valentin Bartenev
2021-03-25 16:15:03 +03:00
parent c849483862
commit 067c6096e2
2 changed files with 2 additions and 2 deletions

View File

@@ -170,7 +170,7 @@ ${NXT_NODE_VERSION_FILE}: ${NXT_VERSION_H}
${NXT_NODE_PACKAGE_FILE}: ${NXT_VERSION_H} src/nodejs/unit-http/package.json
mkdir -p ${NXT_BUILD_DIR}/src/${NXT_NODE}
sed -e 's/"version"\s*:.*/"version": "\$(NXT_VERSION)",/' \
sed -e "s|%%VERSION%%|\$(NXT_VERSION)|" \
src/nodejs/unit-http/package.json > ${NXT_NODE_PACKAGE_FILE}
${NXT_NODE_TARBALL}: ${NXT_NODE}-copy