Skip to content

Commit

Permalink
[fix] copy down versioned installs in case we use multiple ABIs
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeck committed Jan 6, 2012
1 parent cc49690 commit 2e2d3c1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -2,7 +2,8 @@
build/
build/*
*.swp
*.node
node_modules
npm-debug.log
fixtures/*
fixtures/!.gitkeep
fixtures/!.gitkeep
9 changes: 9 additions & 0 deletions install
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

version=`node -v`
node-waf configure build
if [ -f build/Release/daemon.node ]; then
cp build/Release/daemon.node "lib/daemon.$version.node"
elif [ -f build/default/daemon.node ]; then
cp build/default/daemon.node "lib/daemon.$version.node"
fi
7 changes: 1 addition & 6 deletions lib/daemon.js
Expand Up @@ -9,12 +9,7 @@
var fs = require('fs'),
binding;

//
// Try catch here around multiple build paths to support
// `node@0.4.x` and `node@0.6.x`.
//
try { binding = require('../build/default/daemon') }
catch (ex) { binding = require('../build/Release/daemon') }
binding = require('./daemon.' + process.version);

var daemon = exports;

Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -19,9 +19,9 @@
},
"main": "./lib/daemon",
"scripts" : {
"preinstall" : "node-waf configure build"
"preinstall" : "bash ./install"
},
"engines" : {
"node" : ">= 0.4.0"
}
}
}

0 comments on commit 2e2d3c1

Please sign in to comment.