Skip to content

Commit

Permalink
Remove shell completion support (#447)
Browse files Browse the repository at this point in the history
tabtab is rather buggy and the alternative, commander-completion, needs
a custom completion script to be written and maintained.
  • Loading branch information
malept authored and MarshallOfSound committed Apr 8, 2018
1 parent ac04cf9 commit 6c6c798
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 77 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"s3": "^4.4.0",
"semver": "^5.3.0",
"sudo-prompt": "^8.0.0",
"tabtab": "^2.2.1",
"username": "^3.0.0",
"yarn-or-npm": "^2.0.2",
"zip-folder": "^1.0.0"
Expand Down
5 changes: 2 additions & 3 deletions packages/api/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@
"commander": "^2.9.0",
"debug": "^3.0.0",
"fs-extra": "^5.0.0",
"semver": "^5.3.0",
"tabtab": "^2.2.1"
"semver": "^5.3.0"
},
"engines": {
"node": ">= 6.0"
}
}
}
44 changes: 12 additions & 32 deletions packages/api/cli/src/electron-forge.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import 'colors';
import { asyncOra } from '@electron-forge/async-ora';
import program from 'commander';
import tabtab from 'tabtab';

import './util/terminate';

Expand Down Expand Up @@ -37,36 +36,17 @@ program
.command('publish', 'Publish the current Electron application to GitHub')
.command('install', 'Install an Electron application from GitHub');

const tab = tabtab({
name: 'electron-forge',
});
tab.on('electron-forge', (data, done) => {
if (data.line.split(' ').length <= 2) {
done(
null,
program.commands
.filter(cmd => cmd._name.startsWith(data.lastPartial))
.map(cmd => `${cmd._name}:${cmd._description}`).sort()
);
} else {
done(null, []);
}
});
tab.start();

if (process.argv[2] !== 'completion') {
(async () => {
let goodSystem;
await asyncOra('Checking your system', async (ora) => {
goodSystem = await checkSystem(ora);
});
(async () => {
let goodSystem;
await asyncOra('Checking your system', async (ora) => {
goodSystem = await checkSystem(ora);
});

if (!goodSystem) {
console.error(('It looks like you are missing some dependencies you need to get Electron running.\n' +
'Make sure you have git installed and Node.js version 6.0.0+').red);
process.exit(1);
}
if (!goodSystem) {
console.error(('It looks like you are missing some dependencies you need to get Electron running.\n' +
'Make sure you have git installed and Node.js version 6.0.0+').red);
process.exit(1);
}

program.parse(process.argv);
})();
}
program.parse(process.argv);
})();
21 changes: 0 additions & 21 deletions packages/api/core/tabtab-install.js

This file was deleted.

23 changes: 3 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3949,7 +3949,7 @@ init-package-json@~1.9.4:
validate-npm-package-license "^3.0.1"
validate-npm-package-name "^3.0.0"

[email protected], inquirer@^1.0.2:
[email protected]:
version "1.2.3"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-1.2.3.tgz#4dec6f32f37ef7bb0b2ed3f1d1a5c3f545074918"
dependencies:
Expand Down Expand Up @@ -4721,10 +4721,6 @@ lodash.defaults@^4.0.1, lodash.defaults@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"

lodash.difference@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.difference/-/lodash.difference-4.5.0.tgz#9ccb4e505d486b91651345772885a2df27fd017c"

lodash.endswith@^4.0.1, lodash.endswith@^4.2.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/lodash.endswith/-/lodash.endswith-4.2.1.tgz#fed59ac1738ed3e236edd7064ec456448b37bc09"
Expand Down Expand Up @@ -4826,7 +4822,7 @@ lodash.union@~4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88"

lodash.uniq@^4.5.0, lodash.uniq@~4.5.0:
lodash.uniq@~4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"

Expand Down Expand Up @@ -5712,7 +5708,7 @@ [email protected]:
gauge "~2.7.3"
set-blocking "~2.0.0"

"[email protected] || 1 || 2", npmlog@^2.0.3, npmlog@~2.0.4:
"[email protected] || 1 || 2", npmlog@~2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-2.0.4.tgz#98b52530f2514ca90d09ec5b22c8846722375692"
dependencies:
Expand Down Expand Up @@ -7509,19 +7505,6 @@ table@^3.7.8:
slice-ansi "0.0.4"
string-width "^2.0.0"

tabtab@^2.2.1:
version "2.2.2"
resolved "https://registry.yarnpkg.com/tabtab/-/tabtab-2.2.2.tgz#7a047f143b010b4cbd31f857e82961512cbf4e14"
dependencies:
debug "^2.2.0"
inquirer "^1.0.2"
lodash.difference "^4.5.0"
lodash.uniq "^4.5.0"
minimist "^1.2.0"
mkdirp "^0.5.1"
npmlog "^2.0.3"
object-assign "^4.1.0"

[email protected]:
version "2.7.2"
resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.7.2.tgz#7bf8106a5c1a48251b3e3bc0a0e1732489fd0dc8"
Expand Down

0 comments on commit 6c6c798

Please sign in to comment.