Commit a7386200 authored by Johan Oudinet's avatar Johan Oudinet Committed by JC Brand

Makefile: Simplify sed commands

And fix an extra space added by mistake by the sed command on
_converse.VERSION_NAME in converse-core.js.
parent c5bd4c62
...@@ -26,6 +26,7 @@ UGLIFYJS ?= node_modules/.bin/uglifyjs ...@@ -26,6 +26,7 @@ UGLIFYJS ?= node_modules/.bin/uglifyjs
# Internal variables. # Internal variables.
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ./docs/source ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ./docs/source
VERSION_FORMAT = [0-9]+\.[0-9]+\.[0-9]+
.PHONY: all .PHONY: all
all: dev dist all: dev dist
...@@ -85,18 +86,15 @@ po2json: ...@@ -85,18 +86,15 @@ po2json:
.PHONY: release .PHONY: release
release: release:
$(SED) -ri 's/_converse.VERSION_NAME = "v[0-9]+\.[0-9]+\.[0-9]+";/ _converse.VERSION_NAME = "v$(VERSION)";/' src/headless/converse-core.js $(SED) -i '/^_converse.VERSION_NAME =/s/=.*/= "v$(VERSION)";/' src/headless/converse-core.js
$(SED) -ri s/Version:\ [0-9]\+\.[0-9]\+\.[0-9]\+/Version:\ $(VERSION)/ COPYRIGHT $(SED) -i '/Version:/s/:.*/: $(VERSION)/' COPYRIGHT
$(SED) -ri s/Project-Id-Version:\ Converse\.js\ [0-9]\+\.[0-9]\+\.[0-9]\+/Project-Id-Version:\ Converse.js\ $(VERSION)/ locale/converse.pot $(SED) -i '/Project-Id-Version:/s/:.*/: Converse.js $(VERSION)\n"/' locale/converse.pot
$(SED) -ri s/\"version\":\ \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/\"version\":\ \"$(VERSION)\"/ package.json $(SED) -i '/"version":/s/:.*/: "$(VERSION)",/' package.json
$(SED) -ri s/\"version\":\ \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/\"version\":\ \"$(VERSION)\"/ src/headless/package.json $(SED) -i '/"version":/s/:.*/: "$(VERSION)",/' src/headless/package.json
$(SED) -ri s/--package-version=[0-9]\+\.[0-9]\+\.[0-9]\+/--package-version=$(VERSION)/ Makefile $(SED) -ri 's/--package-version=$(VERSION_FORMAT)/--package-version=$(VERSION)/' Makefile
$(SED) -ri s/v[0-9]\+\.[0-9]\+\.[0-9]\+\.zip/v$(VERSION)\.zip/ index.html $(SED) -i -e "/version =/s/=.*/= '$(VERSION)'/" -e "/release =/s/=.*/= '$(VERSION)'/" docs/source/conf.py
$(SED) -ri s/v[0-9]\+\.[0-9]\+\.[0-9]\+\.tar\.gz/v$(VERSION)\.tar\.gz/ index.html $(SED) -i "s/[Uu]nreleased/`date +%Y-%m-%d`/" CHANGES.md
$(SED) -ri s/version\ =\ \'[0-9]\+\.[0-9]\+\.[0-9]\+\'/version\ =\ \'$(VERSION)\'/ docs/source/conf.py $(SED) -ri 's,cdn.conversejs.org/$(VERSION_FORMAT),cdn.conversejs.org/$(VERSION),' docs/source/quickstart.rst
$(SED) -ri s/release\ =\ \'[0-9]\+\.[0-9]\+\.[0-9]\+\'/release\ =\ \'$(VERSION)\'/ docs/source/conf.py
$(SED) -ri "s/(Unreleased)/`date +%Y-%m-%d`/" CHANGES.md
$(SED) -ri "s/cdn.conversejs.org\/[0-9]+\.[0-9]+\.[0-9]+/cdn.conversejs.org\/$(VERSION)/" docs/source/quickstart.rst
make pot make pot
make po make po
make po2json make po2json
......
...@@ -72,7 +72,7 @@ const _converse = { ...@@ -72,7 +72,7 @@ const _converse = {
'promises': {} 'promises': {}
} }
_converse.VERSION_NAME = "v4.1.0"; _converse.VERSION_NAME = "v4.1.0";
_.extend(_converse, Backbone.Events); _.extend(_converse, Backbone.Events);
...@@ -1644,7 +1644,7 @@ _converse.api = { ...@@ -1644,7 +1644,7 @@ _converse.api = {
*/ */
'send' (stanza) { 'send' (stanza) {
_converse.connection.send(stanza); _converse.connection.send(stanza);
_converse.emit('send', stanza); _converse.emit('send', stanza);
}, },
/** /**
...@@ -1657,7 +1657,7 @@ _converse.api = { ...@@ -1657,7 +1657,7 @@ _converse.api = {
'sendIQ' (stanza, timeout) { 'sendIQ' (stanza, timeout) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
_converse.connection.sendIQ(stanza, resolve, reject, timeout || _converse.IQ_TIMEOUT); _converse.connection.sendIQ(stanza, resolve, reject, timeout || _converse.IQ_TIMEOUT);
_converse.emit('send', stanza); _converse.emit('send', stanza);
}); });
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment