ensure you only do this when there aren't uncommitted changes

This commit is contained in:
Brendan Forster 2018-02-04 22:19:19 +11:00
parent 44246b07c7
commit 5d1ad00ef8

View file

@ -64,13 +64,13 @@ function printInstructions(nextVersion: string, entries: Array<string>) {
}
export async function run(args: ReadonlyArray<string>): Promise<void> {
//try {
// await spawn('git', ['diff-index', '--quiet', 'HEAD'])
//} catch {
// throw new Error(
// `There are uncommitted changes in the working directory. Aborting...`
// )
//}
try {
await spawn('git', ['diff-index', '--quiet', 'HEAD'])
} catch {
throw new Error(
`There are uncommitted changes in the working directory. Aborting...`
)
}
if (args.length === 0) {
throw new Error(