Skip to content

Commit

Permalink
feature: wisdom: @putout/cli-choose v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Oct 31, 2023
1 parent 7a13c21 commit 141739e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
29 changes: 6 additions & 23 deletions lib/prompts.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,16 @@
import enquirer from 'enquirer';
import actions from 'enquirer/lib/combos.js';
import tryToCatch from 'try-to-catch';
import {choose as chooseCLI} from '@putout/cli-choose';

const {Select, Confirm} = enquirer;

const custom = {
h: 'left',
j: 'down',
k: 'up',
l: 'right',
};

actions.keys = {
...actions.keys,
...custom,
};

export const choose = async () => {
const prompt = new Select({
name: 'version',
message: 'What type of changes are you goint to publish 🎁 ?',
choices: [
'patch',
'minor',
'major',
],
});

return await run(prompt);
return chooseCLI('What type of changes are you goint to publish 🎁 ?', [
'patch',
'minor',
'major',
]);
};

export const ask = async (name, version) => {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"url": "git://github.com/coderaiser/wisdom.git"
},
"dependencies": {
"@putout/cli-choose": "^1.0.1",
"changelog-io": "^8.0.0",
"currify": "^4.0.0",
"enquirer": "^2.3.6",
Expand Down

0 comments on commit 141739e

Please sign in to comment.