mirror of https://github.com/SeanOMik/znc-push.git
Add support for versioning
When building znc-push with the makefile, it will modify the PUSHVERSION define with version info from `git describe`, build the module, and then reset PUSHVERSION back to "dev". When building directly from znc-buildmod, this will ensure the version is always just "dev". A matching command -- `version` -- has been added to the module which will simply echo the value of PUSHVERSION at the time of compilation.
This commit is contained in:
parent
080c767aae
commit
f6e4801c93
4
Makefile
4
Makefile
|
@ -1,5 +1,9 @@
|
|||
version := $(shell git describe)
|
||||
|
||||
push.so: push.cpp
|
||||
sed -i -e "s|PUSHVERSION \".*\"|PUSHVERSION \"$(version)\"|" push.cpp
|
||||
znc-buildmod push.cpp
|
||||
sed -i -e "s|PUSHVERSION \".*\"|PUSHVERSION \"dev\"|" push.cpp
|
||||
|
||||
install: push.so
|
||||
cp push.so $(HOME)/.znc/modules/push.so
|
||||
|
|
|
@ -99,6 +99,10 @@ Commands
|
|||
|
||||
Links you to this fine document.
|
||||
|
||||
* `version`
|
||||
|
||||
Tells you the tagged build version currently running.
|
||||
|
||||
* `set <option> <value>`
|
||||
|
||||
Allows you to modify configuration values.
|
||||
|
|
6
push.cpp
6
push.cpp
|
@ -9,6 +9,7 @@
|
|||
*/
|
||||
|
||||
#define REQUIRESSL
|
||||
#define PUSHVERSION "dev"
|
||||
|
||||
#include <znc/znc.h>
|
||||
#include <znc/Chan.h>
|
||||
|
@ -1425,6 +1426,11 @@ class CPushMod : public CModule
|
|||
{
|
||||
PutModule("View the detailed documentation at https://github.com/jreese/znc-push/blob/master/README.md");
|
||||
}
|
||||
// VERSION command
|
||||
else if (action == "version")
|
||||
{
|
||||
PutModule("znc-push " + CString(PUSHVERSION));
|
||||
}
|
||||
// EVAL command
|
||||
else if (action == "eval")
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue