Skip to content

Commit

Permalink
adding optional parameter to commit function for branch
Browse files Browse the repository at this point in the history
  • Loading branch information
pellicceama committed Nov 2, 2022
1 parent ecca45b commit 06bb7a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ if (!isDev()) {
shell.config.silent = true;
}

export async function commit(repo: string, message: string): Promise<void> {
export async function commit(repo: string, message: string, branchName?: string): Promise<void> {
try {
if(branchName) {
await branch(repo, branchName);
}

console.log(`Committing ${repo} msg = ${message}`);
const cmd = `cd ${repo} ;` + ` git add . &&` + ` git commit -m "${message}"`;

Expand Down

0 comments on commit 06bb7a3

Please sign in to comment.