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:
@@ -79,6 +79,12 @@ ${chalk.grey('——————————————————')}`
|
|||||||
|
|
||||||
const remotes = await getGitRemotes();
|
const remotes = await getGitRemotes();
|
||||||
|
|
||||||
|
if (!remotes.length) {
|
||||||
|
const { stdout } = await execa('git', ['push']);
|
||||||
|
if (stdout) outro(stdout);
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (remotes.length === 1) {
|
if (remotes.length === 1) {
|
||||||
const isPushConfirmedByUser = await confirm({
|
const isPushConfirmedByUser = await confirm({
|
||||||
message: 'Do you want to run `git push`?'
|
message: 'Do you want to run `git push`?'
|
||||||
|
|||||||
@@ -11,16 +11,13 @@ const platform = process.platform;
|
|||||||
|
|
||||||
let separator = '';
|
let separator = '';
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
// Windows
|
case 'win32': // Windows
|
||||||
case 'win32':
|
|
||||||
separator = path.sep;
|
separator = path.sep;
|
||||||
break;
|
break;
|
||||||
// macOS
|
case 'darwin': // macOS
|
||||||
case 'darwin':
|
|
||||||
separator = '';
|
separator = '';
|
||||||
break;
|
break;
|
||||||
// Linux
|
case 'linux': // Linux
|
||||||
case 'linux':
|
|
||||||
separator = '';
|
separator = '';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user