-
-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(generic): tabtab install breaks in bash for windows
- Loading branch information
1 parent
4d5378c
commit a5f8b40
Showing
1 changed file
with
17 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
const Complete = require('tabtab/src/complete'); | ||
const Installer = require('tabtab/src/installer'); | ||
try { | ||
const Complete = require('tabtab/src/complete'); | ||
const Installer = require('tabtab/src/installer'); | ||
|
||
const options = { auto: true, name: 'electron-forge' }; | ||
const complete = new Complete(options); | ||
const installer = new Installer(options, complete); | ||
const options = { auto: true, name: 'electron-forge' }; | ||
const complete = new Complete(options); | ||
const installer = new Installer(options, complete); | ||
|
||
let shell = process.env.SHELL; | ||
if (shell) shell = shell.split((process.platform !== 'win32') ? '/' : '\\').slice(-1)[0]; | ||
let shell = process.env.SHELL; | ||
if (shell) shell = shell.split((process.platform !== 'win32') ? '/' : '\\').slice(-1)[0]; | ||
|
||
if (installer[shell]) { | ||
installer.handle(options.name, options) | ||
.catch(e => console.warn(`Failed to install tab completion: ${e}`)); | ||
} else { | ||
console.warn(`User shell ${shell} not supported, skipping completion install`); | ||
if (installer[shell]) { | ||
installer.handle(options.name, options) | ||
.catch(e => console.warn(`Failed to install tab completion: ${e}`)); | ||
} else { | ||
console.warn(`User shell ${shell} not supported, skipping completion install`); | ||
} | ||
} catch (err) { | ||
console.log('tabtab install went wrong', err); | ||
process.exit(0); | ||
} |