Skip to content

Commit

Permalink
Add node-i2c install script based on node vesion.
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarsilva committed Mar 13, 2015
1 parent 75cc902 commit d367a92
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

"license": "Apache 2.0",

"scripts": {
"install": "./scripts/install-i2c.sh"
},

"devDependencies": {
"sinon-chai": "~2.4.0",
"chai": "~1.7.2",
Expand Down
11 changes: 11 additions & 0 deletions scripts/install-i2c.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

node_version=$(node -v);

echo "Installing i2c module for node $node_version"

if [[ $node_version == *"v0.10."* ]]; then
npm install i2c@0.1.8
else
npm install i2c
fi

0 comments on commit d367a92

Please sign in to comment.