From 06bb7a3fac57e2e6e4676d18aa5df09d80df01c2 Mon Sep 17 00:00:00 2001 From: Amadeo Pellicce Date: Wed, 2 Nov 2022 14:11:39 +0100 Subject: [PATCH] adding optional parameter to commit function for branch --- src/utils/git.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/git.ts b/src/utils/git.ts index 17cbe1a..43ecfe5 100644 --- a/src/utils/git.ts +++ b/src/utils/git.ts @@ -7,8 +7,12 @@ if (!isDev()) { shell.config.silent = true; } -export async function commit(repo: string, message: string): Promise { +export async function commit(repo: string, message: string, branchName?: string): Promise { try { + if(branchName) { + await branch(repo, branchName); + } + console.log(`Committing ${repo} msg = ${message}`); const cmd = `cd ${repo} ;` + ` git add . &&` + ` git commit -m "${message}"`;