Fix: a bug that causes an error when pushing without setting git remote (#396)

This commit is contained in:
Takanori Matsumoto
2024-09-05 00:42:54 +09:00
committed by GitHub
parent 1d19ddd9e2
commit fa1cf46050
6 changed files with 218 additions and 6 deletions
+4 -1
View File
@@ -107,13 +107,16 @@ ${chalk.grey('——————————————————')}`
const remotes = await getGitRemotes();
// user isn't pushing, return early
if (config.OCO_GITPUSH === false) return;
if (!remotes.length) {
const { stdout } = await execa('git', ['push']);
if (stdout) outro(stdout);
process.exit(0);
}
if (remotes.length === 1 && config.OCO_GITPUSH !== true) {
if (remotes.length === 1) {
const isPushConfirmedByUser = await confirm({
message: 'Do you want to run `git push`?'
});