diff --git a/README.md b/README.md index a813a84..6902cad 100644 --- a/README.md +++ b/README.md @@ -483,15 +483,23 @@ For unacceptable values throws TypeError. Exports: * `paths(dir)` - function. Returns a set of platform dependent paths depending on input `dir`. - * `bin` - platform binary path. - * `rem` - a space-separated list of binary paths to be cleaned on this platform. - * `include` - include directory for this `dir`. -* `root` - where `'addon-tools-raub'` module is situated. + * `bin()` - prints platform binary path. + * `rem()` - prints a space-separated list of binary paths to be cleaned on this platform. + * `include()` - prints include directory for this `dir`. + * `binPath` - platform binary path. + * `remPath` - a space-separated list of binary paths to be cleaned on this platform. + * `includePath` - include directory for this `dir`. +* `root()` - prints where `'addon-tools-raub'` module is situated. * `include()` - prints both `'addon-tools-raub'` and `'nan'` include paths. Use with `node -e` through list context command expansion ` { process.env.path = `${process.env.path ? `${process.env.path};` : ''}${binPath}`; } + const remPath = remDirs.map(k => `${dir}/${k}`).join(' '); + const includePath = `${dir}/include`; + return { + + binPath, + remPath, + includePath, + bin() { console.log(binPath); }, - rem() { console.log(remDirs.map(k => `${dir}/${k}`).join(' ')); }, - include() { console.log(`${dir}/include`); }, + rem() { console.log(remPath); }, + include() { console.log(includePath); }, + }; }; +const includePath = `${nanInclude} ${thisInclude}`; + +const mkdirPath = isWindows ? `${rootPath}/_mkdir.bat` : 'mkdir'; +const rmPath = isWindows ? `${rootPath}/_rm.bat` : 'rm'; +const cpPath = isWindows ? `${rootPath}/_cp.bat` : 'cp'; + module.exports = { paths, - root() { return console.log(thisDir); }, - include() { console.log(`${nanInclude} ${thisInclude}`); }, - mkdir() { return console.log(isWindows ? `${thisDir}/_mkdir.bat` : 'mkdir'); }, - rm() { return console.log(isWindows ? `${thisDir}/_rm.bat` : 'rm'); }, - cp() { return console.log(isWindows ? `${thisDir}/_cp.bat` : 'cp'); }, + rootPath, + includePath, + mkdirPath, + rmPath, + cpPath, + + root() { return console.log(rootPath); }, + include() { console.log(includePath); }, + + mkdir() { return console.log(mkdirPath); }, + rm() { return console.log(rmPath); }, + cp() { return console.log(cpPath); }, }; diff --git a/package.json b/package.json index 1240593..84f3b43 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "addon-tools-raub", "author": "Luis Blanco ", "description": "A set of extra tools for Node.js addons", - "version": "0.0.7", + "version": "0.0.8", "main": "index.js", "keywords": [ "node",