From 1ce2fcee9ba077f558a064c629631d06bd0e4dbe Mon Sep 17 00:00:00 2001 From: Luis Blanco Date: Thu, 1 Feb 2018 13:49:31 +0300 Subject: [PATCH] fix, compact, refactor --- README.md | 101 +++++++++++++++-------------------------------------- _mkdir.bat | 7 +--- _rm.bat | 11 ++---- index.js | 15 +++++--- 4 files changed, 42 insertions(+), 92 deletions(-) diff --git a/README.md b/README.md index 304d1a4..2306ce5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This is a set of helpers for simplification and standardization of addons and dependency packages. -* Contains helpers of following types: GYP, C++, JS, BAT(Windows). +* Contains helpers of following types: GYP, C++, JS, BAT (Windows). * Platforms: win x32/x64, linux x32/x64, mac x64. * Useful links: [V8 Ref](https://v8docs.nodesource.com/node-0.8/d2/dc3/namespacev8.html), [Nan Docs](https://github.com/nodejs/nan#api), @@ -28,7 +28,7 @@ dependency packages. [index.js](#indexjs) -[Crossplatform commands](#crossplatform-commands) +[Cross-platform commands](#cross-platform-commands) --- @@ -38,12 +38,13 @@ dependency packages. ### binding.gyp -* For Windows custom file/folder removers/creators are present, you can put them into variables. +* Cross-platform file/folder removers/creators are present, you can put them into variables for later use. ``` 'variables': { - 'rmrf' : ' `bin-${name}`; @@ -16,8 +22,8 @@ const getPlatformDir = platform => { } }; -const currentDir = prefixName(getPlatformDir(process.platform)); +const currentDir = prefixName(getPlatformDir(process.platform)); const remDirs = names.map(prefixName).filter(n => n !== currentDir); @@ -45,12 +51,11 @@ module.exports = { paths, root : thisDir, - include : `${thisDir}/include`, - printNan() { require('nan'); }, + include() { console.log(`${nanInclude} ${thisInclude}`); }, mkdir : process.platform === 'win32' ? `${thisDir}/_mkdir.bat` : 'mkdir', - rm : process.platform === 'win32' ? `${thisDir}/_rm.bat` : 'rm', - cp : process.platform === 'win32' ? `${thisDir}/_cp.bat` : 'cp', + rm : process.platform === 'win32' ? `${thisDir}/_rm.bat` : 'rm', + cp : process.platform === 'win32' ? `${thisDir}/_cp.bat` : 'cp', };