diff --git a/helpers/gitSubRepoUtils.ts b/helpers/gitSubRepoUtils.ts index 69728c5..dfccbe1 100644 --- a/helpers/gitSubRepoUtils.ts +++ b/helpers/gitSubRepoUtils.ts @@ -11,14 +11,14 @@ export const subRepositoryClean = async (subRepoRelPath) => { const repo = `${process.env.JJ_WORKSPACE_DIR}/${subRepoRelPath}` logger.log(`clean repository ${repo} start`) const command = ` -pushd "${repo}" > /dev/null - git stash --include-untracked || true - git clean -f -X -e ".~envFormat" -e ".~jsonFormat" -e ".~shellFormat" || true - git clean -f -x -e ".~envFormat" -e ".~jsonFormat" -e ".~shellFormat" || true - git clean -xdf -e ".~envFormat" -e ".~jsonFormat" -e ".~shellFormat" || true - git reset --hard || true +cd ${repo} + +git stash --include-untracked || true +git clean -f -X -e ".~envFormat" -e ".~jsonFormat" -e ".~shellFormat" || true +git clean -f -x -e ".~envFormat" -e ".~jsonFormat" -e ".~shellFormat" || true +git clean -xdf -e ".~envFormat" -e ".~jsonFormat" -e ".~shellFormat" || true +git reset --hard || true -popd > /dev/null ` const res = await bashRunAndReturnSync({ command: command @@ -37,12 +37,11 @@ export const subRepositoryPull = async (subRepoRelPath, branch, noLogger = false logger.log(`pull repository ${repo} on ${branch} branch start`) } const command = ` -pushd "${repo}" > /dev/null - git checkout ${branch} || true - git config pull.rebase false --replace-all || true - git pull origin || true +cd "${repo}" +git checkout ${branch} || true +git config pull.rebase false --replace-all || true +git pull origin || true -popd > /dev/null ` const res = await bashRunAndReturnSync({ command: command @@ -65,7 +64,7 @@ export const subRepositoryPushChanges = async (subRepoRelPath, branch, commitMes await subRepositoryPull(subRepoRelPath, branch) await setTimeout(1000) const command = ` -pushd "${repo}" > /dev/null +cd "${repo}" git status || true git add . || true git status || true @@ -73,7 +72,6 @@ pushd "${repo}" > /dev/null git diff --cached --color | cat || true git commit -m "${commitMessage}" || true git push origin || true -popd > /dev/null ` const res = await bashRunAndReturnSync({ command: command, diff --git a/package.json b/package.json index 9127de4..d16b914 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@sarava-npm-packages/jj-command-line", "description": "jj cli", - "version": "2.1.8", + "version": "2.1.9", "author": "Jason Jafari", "bin": { "jj": "./jj.sh"