add enquire
This commit is contained in:
parent
2bf41f6d71
commit
bf32c59770
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
node_modules/
|
||||
pnpm-debug.log
|
||||
pnpm-lock.yaml
|
||||
dist
|
||||
|
@ -10,6 +10,7 @@
|
||||
"author": "Yanick Champoux <yanick@babyl.ca> (http://techblog.babyl.ca)",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@types/inquirer": "^7.3.1",
|
||||
"@types/node": "^14.14.16",
|
||||
"@types/yargs": "^15.0.12",
|
||||
"inquirer": "^7.3.3",
|
||||
|
@ -1,13 +1,27 @@
|
||||
import Git from 'simple-git';
|
||||
import inquirer from 'inquirer';
|
||||
|
||||
async function check_workspace_clean() {
|
||||
return Git().status().then( (result) => {
|
||||
if(!result.isClean()) throw new Error('workspace not clean, aborting');
|
||||
})
|
||||
return Git().status().then((result) => {
|
||||
if (!result.isClean()) throw new Error('workspace not clean, aborting');
|
||||
})
|
||||
}
|
||||
|
||||
export default async () => {
|
||||
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