Skip to content

Commit

Permalink
fix(tabtab): dont install tabtab in a development environment and ign…
Browse files Browse the repository at this point in the history
…ore tabtab install errors

ISSUES CLOSED: #98
  • Loading branch information
MarshallOfSound authored and malept committed Jan 29, 2017
1 parent aa8034b commit f0cb041
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"precommit": "npm run lint",
"commit": "git-cz",
"docs": "esdoc",
"install": "tabtab install --auto",
"install": "node tabtab-install.js",
"lint": "eslint src test gulpfile.babel.js",
"prepublish": "gulp build",
"pretest": "gulp build",
Expand Down
11 changes: 11 additions & 0 deletions tabtab-install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const fs = require('fs');
const path = require('path');
const { findActualExecutable, spawnPromise } = require('spawn-rx');

const tabtabPath = path.resolve(__dirname, './node_modules/.bin/tabtab');

if (!fs.existsSync(path.resolve(__dirname, 'src'))) {
spawnPromise(findActualExecutable(tabtabPath).cmd, ['install', '--auto'], {
stdio: 'inherit',
}).catch(err => console.error('Failed to install tab completion:', err));
}

0 comments on commit f0cb041

Please sign in to comment.