Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
fix: allow deploy without init git
Browse files Browse the repository at this point in the history
  • Loading branch information
arantespp committed Oct 17, 2020
1 parent e8a436a commit f8e719e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/cli/src/utils/getCurrentBranch.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import git from 'simple-git';

export const getCurrentBranch = () =>
git()
.branch()
.then(({ current }) => current || 'branch_undefined');
const branchUndefined = '';

export const getCurrentBranch = async () => {
try {
return git()
.branch()
.then(({ current }) => current || branchUndefined)
.catch(() => branchUndefined);
} catch {
return branchUndefined;
}
};

0 comments on commit f8e719e

Please sign in to comment.