({ cwd, skipChecks })
| 110 | * @param {{ cwd: String, dryRun: Boolean; skipChecks: Boolean; }} options |
| 111 | */ |
| 112 | export async function hasUncommittedChanges({ cwd, skipChecks }) { |
| 113 | const execArgs = ['status', '--porcelain', '-uno']; |
| 114 | const { stdout } = await execAsyncPiped('git', execArgs, { cwd }); |
| 115 | if (stdout.length && !skipChecks) { |
| 116 | throw Error('Working tree has uncommitted changes, please commit or remove the following changes before continuing.'); |
| 117 | } |
| 118 | } |
no test coverage detected