From 1c0703dc1cea98120fc3866f12735dfd76a6108e Mon Sep 17 00:00:00 2001 From: Paolo Antinori Date: Wed, 8 Jul 2015 09:20:16 +0200 Subject: [PATCH] Added filtering --- bin/git-bc | 2 +- index.js | 2 +- package.json | 2 +- test.log | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 test.log diff --git a/bin/git-bc b/bin/git-bc index 0a68b85..f03d589 100755 --- a/bin/git-bc +++ b/bin/git-bc @@ -21,7 +21,7 @@ if (opts.indexOf('-h') > -1) { // Exits program execution on ESC keypress process.stdin.on('keypress', function (ch, key) { - if (key && (key.name === 'escape' || key.name === 'q')) { + if (key && (key.name === 'escape')) { process.exit(); } }); diff --git a/index.js b/index.js index 1f22cea..d2c92cf 100755 --- a/index.js +++ b/index.js @@ -40,7 +40,7 @@ module.exports = function gitBranchCheckout(exec, options) { function promptList(branches) { result.prompt = inquirer.prompt([{ - type: 'list', + type: 'filter', name: 'branches', message: 'Select a branch to checkout:', choices: branches.filter( diff --git a/package.json b/package.json index 0c9655b..434ddc7 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "checkout" ], "dependencies": { - "inquirer": "^0.8.x", + "inquirer": "https://github.com/paoloantinori/Inquirer.js/tarball/f69a7de925576e9ea3c4bd49734bb6f771183676", "simple-output": "^1.0.x" }, "devDependencies": { diff --git a/test.log b/test.log new file mode 100644 index 0000000..828e67a --- /dev/null +++ b/test.log @@ -0,0 +1,2 @@ +[?25l[?25h +