refactor(commit.ts): add push command when no remotes are found

refactor(githook.ts): simplify switch statement by removing comments and adding inline comments
This commit is contained in:
di-sukharev
2023-04-01 13:24:15 +08:00
parent e2f68b7256
commit 7e5ed6de0b
2 changed files with 9 additions and 6 deletions

View File

@@ -79,6 +79,12 @@ ${chalk.grey('——————————————————')}`
const remotes = await getGitRemotes();
if (!remotes.length) {
const { stdout } = await execa('git', ['push']);
if (stdout) outro(stdout);
process.exit(0);
}
if (remotes.length === 1) {
const isPushConfirmedByUser = await confirm({
message: 'Do you want to run `git push`?'

View File

@@ -11,16 +11,13 @@ const platform = process.platform;
let separator = '';
switch (platform) {
// Windows
case 'win32':
case 'win32': // Windows
separator = path.sep;
break;
// macOS
case 'darwin':
case 'darwin': // macOS
separator = '';
break;
// Linux
case 'linux':
case 'linux': // Linux
separator = '';
break;
default: