Skip to content

Commit

Permalink
Update packaging.
Browse files Browse the repository at this point in the history
  • Loading branch information
caali-hackerman committed Apr 29, 2019
1 parent de4088d commit 43c3cfc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"targets": [{
"target_name": "tera-crypto-native",
"target_name": "tera_crypto_native",
"sources": ["main.cpp"]
}]
}
13 changes: 9 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
const fs = require('fs')

const file = `${__dirname}/bin/${process.arch}/tera-crypto-native_${process.versions.modules}.node`
if(!fs.existsSync(file))
throw Error(`tera-crypto-native: No build found (arch=${process.arch}, modulesVer=${process.versions.modules})`)
for(let file of [
`${__dirname}/build/Release/tera_crypto_native.node`,
`${__dirname}/bin/${process.arch}/tera-crypto-native_${process.versions.modules}.node`
])
if(fs.existsSync(file)) {
module.exports = require(file)
return
}

module.exports = require(file)
throw Error(`tera-crypto-native: No build found (arch=${process.arch}, modulesVer=${process.versions.modules})`)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Node.JS C++ addon for fast encryption and decryption of TERA protocol streams.",
"repository": {
"type": "git",
"url": "git+https://github.com/caali-hackerman/tera-crypto-native.git"
"url": "git+https://github.com/tera-toolbox/tera-crypto-native.git"
},
"author": "Pinkie Pie"
}

0 comments on commit 43c3cfc

Please sign in to comment.