🎨 Update addon example

This commit is contained in:
Luis Blanco 2018-05-13 22:59:39 +03:00
parent 3a22850637
commit c77f4f30dd
4 changed files with 10 additions and 6 deletions

View File

@ -3,6 +3,7 @@
.project .project
.lock-wscript .lock-wscript
build*/ build*/
bin-*/
.DS_Store .DS_Store
Debug/ Debug/
node_modules/ node_modules/

View File

@ -6,6 +6,7 @@
.lock-wscript .lock-wscript
.project .project
binary/ binary/
bin-*/
build*/ build*/
CPPLINT.cfg CPPLINT.cfg
Debug/ Debug/

View File

@ -3,6 +3,7 @@
'rm' : '<!(node -e "require(\'addon-tools-raub\').rm()")', 'rm' : '<!(node -e "require(\'addon-tools-raub\').rm()")',
'cp' : '<!(node -e "require(\'addon-tools-raub\').cp()")', 'cp' : '<!(node -e "require(\'addon-tools-raub\').cp()")',
'mkdir' : '<!(node -e "require(\'addon-tools-raub\').mkdir()")', 'mkdir' : '<!(node -e "require(\'addon-tools-raub\').mkdir()")',
'binary' : '<!(node -e "require(\'addon-tools-raub\').bin()")',
}, },
'targets': [ 'targets': [
{ {
@ -41,7 +42,7 @@
'action_name' : 'Directory created.', 'action_name' : 'Directory created.',
'inputs' : [], 'inputs' : [],
'outputs' : ['build'], 'outputs' : ['build'],
'action': ['<(mkdir)', '-p', 'binary'] 'action': ['<(mkdir)', '-p', '<(binary)']
}], }],
}, },
{ {
@ -52,7 +53,7 @@
'action_name' : 'Module copied.', 'action_name' : 'Module copied.',
'inputs' : [], 'inputs' : [],
'outputs' : ['binary'], 'outputs' : ['binary'],
'action' : ['<(cp)', 'build/Release/addon.node', 'binary/addon.node'], 'action' : ['<(cp)', 'build/Release/addon.node', '<(binary)/addon.node'],
}], }],
}, },
{ {

View File

@ -2,7 +2,8 @@
const util = require('util'); const util = require('util');
const core = require('./binary/addon'); const { binPath } = require('addon-tools-raub').paths(__dirname);
const core = require(`${binPath}/addon`);
const { Example } = core; const { Example } = core;