summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2021-03-25 16:15:03 +0300
committerValentin Bartenev <vbart@nginx.com>2021-03-25 16:15:03 +0300
commit067c6096e2ec306c4fdae6993140fbbdf4f9a6fd (patch)
tree8ac964daae973b007e0e683b496d5f1bf3450d62
parentc849483862cba283a123354b9fda7687a9fa32fd (diff)
downloadunit-067c6096e2ec306c4fdae6993140fbbdf4f9a6fd.tar.gz
unit-067c6096e2ec306c4fdae6993140fbbdf4f9a6fd.tar.bz2
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.
-rw-r--r--auto/modules/nodejs2
-rw-r--r--src/nodejs/unit-http/package.json2
2 files changed, 2 insertions, 2 deletions
diff --git a/auto/modules/nodejs b/auto/modules/nodejs
index 100defe4..b2309143 100644
--- a/auto/modules/nodejs
+++ b/auto/modules/nodejs
@@ -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
diff --git a/src/nodejs/unit-http/package.json b/src/nodejs/unit-http/package.json
index 7ee01346..81f06bd4 100644
--- a/src/nodejs/unit-http/package.json
+++ b/src/nodejs/unit-http/package.json
@@ -1,6 +1,6 @@
{
"name": "unit-http",
- "version": "1.0.0",
+ "version": "%%VERSION%%",
"description": "HTTP module for NGINX Unit",
"main": "http.js",
"files": [