1 | try {
|
2 | const Complete = require('tabtab/src/complete');
|
3 | const Installer = require('tabtab/src/installer');
|
4 |
|
5 | const options = { auto: true, name: 'electron-forge' };
|
6 | const complete = new Complete(options);
|
7 | const installer = new Installer(options, complete);
|
8 |
|
9 | let shell = process.env.SHELL;
|
10 | if (shell) shell = shell.split((process.platform !== 'win32') ? '/' : '\\').slice(-1)[0];
|
11 |
|
12 | if (installer[shell]) {
|
13 | installer.handle(options.name, options)
|
14 | .catch(e => console.warn(`Failed to install tab completion: ${e}`));
|
15 | } else {
|
16 | console.warn(`User shell ${shell} not supported, skipping completion install`);
|
17 | }
|
18 | } catch (err) {
|
19 | console.log('tabtab install went wrong', err);
|
20 | process.exit(0);
|
21 | }
|