From 1c2673b763ea086acd660dd4257c9be06eb77667 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 25 May 2023 15:26:13 -0600 Subject: [PATCH] fix: bug with retrieving submodules (#1169) Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> --- dist/index.js | Bin 316749 -> 316798 bytes dist/index.js.map | Bin 372204 -> 372271 bytes src/utils.ts | 19 +++++++++++++------ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 4c43e4592ea32439d5aaa1db8067e2f6dc2418ff..819b8cdaefb0592657402360b704d41481544195 100644 GIT binary patch delta 70 zcmV-M0J;CosuTXI6R>O73M?RHcxiM)Z)9bY0rMx5JKTnsO%VbZlKKaeALa&=aP9}Q c?$_4?lVH>pg9+S+3ETmP3ETp=3ETrj`Bjb|CIA2c delta 94 zcmeyjO8D$5;SJf>C+oaZpFHQf-sB74r6$+kWS^YyiFdQ#jqA)>`uYm#nI#IvrAfK@ yDWy573dJRfC8fm*H42I4*$V2_1x1;8B?>A=wd&0ZciI*1Faj~tc7;34aX$eOSty7A diff --git a/dist/index.js.map b/dist/index.js.map index 300d15bae3c84f2f8126ffb99fd33ba1ae0bc634..0c8d6942cb84e544005c20d79730688e8384175a 100644 GIT binary patch delta 140 zcmaEJTWtLuu?@@$69f1sP2ys<%yimVc#?5)ffHx*BgO5H6dC8YaOo(dR%Dhq=clAj zZ(PP0KHXq5W6bn@!c6SbFGMp7PoKYsk$t-Een#Hy9LpKMGf$7d#>h53UF1U)Do?+6oKa@F!y!hI?bXW}zcXv;>no&ZmM9dLCgtX*l;)%=6qh8Hlol)0C?u9= zE2vi&6lLa>D5x0Ks!#uah*5g_i>Zu8aO3Ky-#f`DK0R+0BX@iH8b%;y0%B$$X4#&; IhV=v^0EnqVAOHXW diff --git a/src/utils.ts b/src/utils.ts index 2b460925..68bc83f7 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -205,10 +205,19 @@ export const submoduleExists = async ({ }: { cwd: string }): Promise => { - const {stdout} = await exec.getExecOutput('git', ['submodule', 'status'], { - cwd, - silent: false - }) + const {stdout, exitCode} = await exec.getExecOutput( + 'git', + ['submodule', 'status'], + { + cwd, + ignoreReturnCode: true, + silent: false + } + ) + + if (exitCode !== 0) { + return false + } return stdout.trim() !== '' } @@ -261,8 +270,6 @@ export const getSubmodulePath = async ({ }: { cwd: string }): Promise => { - // git submodule status | awk '{print $2}' - const {exitCode, stdout, stderr} = await exec.getExecOutput( 'git', ['submodule', 'status'],