add enquire
This commit is contained in:
parent
2bf41f6d71
commit
bf32c59770
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
pnpm-debug.log
|
pnpm-debug.log
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
|
dist
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"author": "Yanick Champoux <yanick@babyl.ca> (http://techblog.babyl.ca)",
|
"author": "Yanick Champoux <yanick@babyl.ca> (http://techblog.babyl.ca)",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@types/inquirer": "^7.3.1",
|
||||||
"@types/node": "^14.14.16",
|
"@types/node": "^14.14.16",
|
||||||
"@types/yargs": "^15.0.12",
|
"@types/yargs": "^15.0.12",
|
||||||
"inquirer": "^7.3.3",
|
"inquirer": "^7.3.3",
|
||||||
|
@ -1,13 +1,27 @@
|
|||||||
import Git from 'simple-git';
|
import Git from 'simple-git';
|
||||||
|
import inquirer from 'inquirer';
|
||||||
|
|
||||||
async function check_workspace_clean() {
|
async function check_workspace_clean() {
|
||||||
return Git().status().then( (result) => {
|
return Git().status().then((result) => {
|
||||||
if(!result.isClean()) throw new Error('workspace not clean, aborting');
|
if (!result.isClean()) throw new Error('workspace not clean, aborting');
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async () => {
|
export default async () => {
|
||||||
await check_workspace_clean();
|
await check_workspace_clean();
|
||||||
|
|
||||||
console.log( 'yay');
|
const result = await Git().branch({'--merged': 'HEAD'});
|
||||||
|
|
||||||
|
const ancestors = result.all;
|
||||||
|
|
||||||
|
const resp = await inquirer.prompt([
|
||||||
|
{
|
||||||
|
name: 'parent',
|
||||||
|
message: 'grand-parent branch: ',
|
||||||
|
type: 'list',
|
||||||
|
choices: ancestors,
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
console.log(resp);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user