leximaven
Advanced tools
Comparing version 2.3.1 to 2.3.2
@@ -1,1 +0,1 @@ | ||
'use strict';var themes=require('../themes');var tools=require('../tools');var _=require('lodash');var child=require('child_process');var noon=require('noon');var CFILE=process.env.HOME+'/.leximaven.noon';exports.command='wordmap <word>';exports.aliases=['map','wm'];exports.desc='Maps of word info';exports.builder={limit:{alias:'l',desc:'Limits the number of results',default:1,type:'number'},save:{alias:'s',desc:'Save flags to config file',default:false,type:'boolean'}};exports.handler=function(argv){tools.checkConfig(CFILE);var config=noon.load(CFILE);var userConfig={wordmap:{limit:argv.l}};if(config.merge)config=_.merge({},config,userConfig);if(argv.s&&config.merge)noon.save(CFILE,config);if(argv.s&&!config.merge)throw new Error("Can't save user config, set option merge to true.");var theme=themes.loadTheme(config.theme);if(config.verbose)themes.label(theme,'down','Wordmap');var word=argv.word;var l=argv.l;var bin=process.cwd()+'/bin/leximaven.js';child.spawnSync('node',[bin,'rbrain','combine','-m'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'rbrain','info',''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'rbrain','rhyme','-m'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','define','-l'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','example','-l'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','hyphen',''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','origin',''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','phrase','-l'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','pronounce','-l'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','relate','-l'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'acronym',''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'dmuse','-m'+l,'ml='+word],{stdio:'inherit'});child.spawnSync('node',[bin,'onelook',''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'urban','-l'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'anagram','-t'+l,''+word],{stdio:'inherit'});}; | ||
'use strict';var themes=require('../themes');var tools=require('../tools');var _=require('lodash');var child=require('child_process');var noon=require('noon');var CFILE=process.env.HOME+'/.leximaven.noon';exports.command='wordmap <word>';exports.aliases=['map','wm'];exports.desc='Maps of word info';exports.builder={limit:{alias:'l',desc:'Limits the number of results',default:1,type:'number'},save:{alias:'s',desc:'Save flags to config file',default:false,type:'boolean'}};exports.handler=function(argv){tools.checkConfig(CFILE);var config=noon.load(CFILE);var userConfig={wordmap:{limit:argv.l}};if(config.merge)config=_.merge({},config,userConfig);if(argv.s&&config.merge)noon.save(CFILE,config);if(argv.s&&!config.merge)throw new Error("Can't save user config, set option merge to true.");var theme=themes.loadTheme(config.theme);if(config.verbose)themes.label(theme,'down','Wordmap');var word=argv.word;var l=argv.l;var bin='';var dirExists=null;try{fs.statSync('bin/leximaven.js');dirExists=true;}catch(e){if(e.code==='ENOENT')dirExists=false;}dirExists?bin='bin/leximaven.js':bin=process.env.NODE_PATH+'/leximaven/bin/leximaven.js';child.spawnSync('node',[bin,'rbrain','combine','-m'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'rbrain','info',''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'rbrain','rhyme','-m'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','define','-l'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','example','-l'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','hyphen',''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','origin',''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','phrase','-l'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','pronounce','-l'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'wordnik','relate','-l'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'acronym',''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'dmuse','-m'+l,'ml='+word],{stdio:'inherit'});child.spawnSync('node',[bin,'onelook',''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'urban','-l'+l,''+word],{stdio:'inherit'});child.spawnSync('node',[bin,'anagram','-t'+l,''+word],{stdio:'inherit'});}; |
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.3.2"></a> | ||
## [2.3.2](https://github.com/drawnepicenter/leximaven/compare/v2.3.1...v2.3.2) (2017-01-29) | ||
### Bug Fixes | ||
* **wordmap:** mapping doesn't work in other directories as a package ([17b01e1](https://github.com/drawnepicenter/leximaven/commit/17b01e1)) | ||
<a name="2.3.1"></a> | ||
@@ -7,0 +17,0 @@ ## [2.3.1](https://github.com/drawnepicenter/leximaven/compare/v2.3.0...v2.3.1) (2017-01-25) |
{ | ||
"name": "leximaven", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "A command line tool for searching word-related APIs.", | ||
@@ -50,3 +50,3 @@ "author": "Andrew Prentice", | ||
"noon": "^1.0.13", | ||
"ora": "^1.0.0", | ||
"ora": "^1.1.0", | ||
"random-word": "^2.0.0", | ||
@@ -61,8 +61,8 @@ "term-size": "^0.1.0", | ||
"devDependencies": { | ||
"babel-cli": "^6.18.0", | ||
"babel-core": "^6.21.0", | ||
"babel-cli": "^6.22.2", | ||
"babel-core": "^6.22.1", | ||
"babel-plugin-istanbul": "^3.1.2", | ||
"babel-plugin-lodash": "^3.2.11", | ||
"babel-preset-latest": "^6.16.0", | ||
"babel-register": "^6.18.0", | ||
"babel-preset-latest": "^6.22.0", | ||
"babel-register": "^6.22.0", | ||
"chai": "^3.5.0", | ||
@@ -72,3 +72,3 @@ "codeclimate-test-reporter": "^0.4.0", | ||
"cz-conventional-changelog": "^1.2.0", | ||
"eslint": "^3.14.0", | ||
"eslint": "^3.14.1", | ||
"ink-docstrap": "^1.3.0", | ||
@@ -75,0 +75,0 @@ "mocha": "^3.2.0", |
@@ -42,3 +42,11 @@ const themes = require('../themes') | ||
const l = argv.l | ||
const bin = `${process.cwd()}/bin/leximaven.js` | ||
let bin = '' | ||
let dirExists = null | ||
try { | ||
fs.statSync('bin/leximaven.js') | ||
dirExists = true | ||
} catch (e) { | ||
if (e.code === 'ENOENT') dirExists = false | ||
} | ||
dirExists ? bin = 'bin/leximaven.js' : bin = `${process.env.NODE_PATH}/leximaven/bin/leximaven.js` | ||
child.spawnSync('node', [bin, 'rbrain', 'combine', `-m${l}`, `${word}`], { stdio: 'inherit' }) | ||
@@ -45,0 +53,0 @@ child.spawnSync('node', [bin, 'rbrain', 'info', `${word}`], { stdio: 'inherit' }) |
287866
2675
92
Updatedora@^1.1.0