Skip to content

Commit

Permalink
version header
Browse files Browse the repository at this point in the history
  • Loading branch information
tokuhirom committed Dec 25, 2011
1 parent 56cc0e4 commit 091e350
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@
build/
hoge.db
node_modules/
version.h
7 changes: 5 additions & 2 deletions Makefile
Expand Up @@ -3,7 +3,10 @@ all: gdbm.node
build/config.log:
node-waf configure

gdbm.node: gdbm.cc build/config.log
version.h:
node author/version.js

gdbm.node: gdbm.cc build/config.log version.h
node-waf

test: gdbm.node
Expand All @@ -13,7 +16,7 @@ deps:
npm install

clean:
rm -rf build/ hoge.db .lock-wscript
rm -rf build/ hoge.db .lock-wscript version.h

push: test clean
npm publish
Expand Down
7 changes: 7 additions & 0 deletions author/version.js
@@ -0,0 +1,7 @@
var fs = require('fs'),
undefined;

var src = fs.readFileSync('package.json', 'utf-8');
var dat = JSON.parse(src);
fs.writeFileSync('version.h', '#define NODE_GDBM_VERSION "' + dat.version + "\"\n");

4 changes: 2 additions & 2 deletions gdbm.cc
Expand Up @@ -6,13 +6,13 @@
#include <stdlib.h>
#include <cstdio>

#include "version.h"

using namespace v8;
using namespace node;

#define THROW(msg) return ThrowException(Exception::Error(String::New(msg)));

#define NODE_GDBM_VERSION "1.0.2"

static Persistent<String> open_symbol;
static Persistent<String> close_symbol;
static Persistent<String> store_symbol;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"author": "Tokuhiro Matsuno <tokuhirom@gmail.com> (http://64p.org/)",
"name": "gdbm",
"description": "gdbm for node.js",
"version": "1.0.2",
"version": "1.0.3",
"url": "https://github.com/tokuhirom/node-gdbm/",
"repository": {
"type": "git",
Expand Down

0 comments on commit 091e350

Please sign in to comment.