Comparing version 0.1.4 to 0.1.5
#!/usr/bin/env node | ||
const args = require('args'); | ||
const fuzzy = require('fuzzy'); | ||
const inquirer = require('inquirer'); | ||
const { yellow, magenta } = require('chalk'); | ||
inquirer.registerPrompt( | ||
'autocomplete', | ||
require('inquirer-autocomplete-prompt') | ||
); | ||
const checkUpdate = require('../lib/check-update'); | ||
@@ -26,9 +32,15 @@ const checkNodeVersion = require('../lib/check-node-version'); | ||
const search = branches => (ans, input = '') => | ||
new Promise(resolve => { | ||
const fuzzyResult = fuzzy.filter(input, branches.map(({ value }) => value)); | ||
resolve(fuzzyResult.map(el => el.original)); | ||
}); | ||
const startCheckout = async branches => { | ||
const { branch } = await inquirer.prompt([ | ||
{ | ||
type: 'list', | ||
type: 'autocomplete', | ||
name: 'branch', | ||
message: 'Which branch do you want to checkout?', | ||
choices: branches, | ||
source: search(branches), | ||
}, | ||
@@ -35,0 +47,0 @@ ]); |
@@ -12,3 +12,3 @@ { | ||
}, | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"bin": { | ||
@@ -23,3 +23,2 @@ "sg": "./bin/swagit.js", | ||
"scripts": { | ||
"precommit": "lint-staged", | ||
"lint": "eslint bin lib", | ||
@@ -31,17 +30,25 @@ "test": "yarn lint" | ||
"chalk": "^2.4.1", | ||
"inquirer": "^6.0.0", | ||
"node-version": "^1.1.3", | ||
"simple-git": "^1.95.1", | ||
"fuzzy": "^0.1.3", | ||
"inquirer": "^6.2.0", | ||
"inquirer-autocomplete-prompt": "^1.0.1", | ||
"node-version": "^1.2.0", | ||
"simple-git": "^1.107.0", | ||
"update-check": "^1.5.2" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^4.19.1", | ||
"eslint-config-yoctol-base": "^0.15.1", | ||
"eslint-plugin-import": "^2.12.0", | ||
"eslint-plugin-prettier": "^2.6.0", | ||
"husky": "^0.14.3", | ||
"lint-staged": "^7.2.0", | ||
"prettier": "^1.13.5", | ||
"prettier-package-json": "^1.6.0" | ||
"eslint": "^5.9.0", | ||
"eslint-config-yoctol-base": "^0.18.0", | ||
"eslint-plugin-import": "^2.14.0", | ||
"eslint-plugin-prettier": "^3.0.0", | ||
"eslint-plugin-sort-imports-es6-autofix": "^0.3.0", | ||
"husky": "^1.1.4", | ||
"lint-staged": "^8.0.4", | ||
"prettier": "^1.15.2", | ||
"prettier-package-json": "^2.0.1" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
@@ -48,0 +55,0 @@ "*.js": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8151
167
8
9
+ Addedfuzzy@^0.1.3
+ Addedansi-escapes@4.3.2(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedfigures@3.2.0(transitive)
+ Addedfuzzy@0.1.3(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedinquirer-autocomplete-prompt@1.4.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedtype-fest@0.21.3(transitive)
Updatedinquirer@^6.2.0
Updatednode-version@^1.2.0
Updatedsimple-git@^1.107.0