From 4ff0689cc3a2be9757d1266f6ae3053fbe7af7fb Mon Sep 17 00:00:00 2001 From: Amadeo Pellicce Date: Sun, 12 Mar 2023 20:26:30 -0700 Subject: [PATCH] fixing issue in updateSubmodulesRecursive --- src/utils/git.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/git.ts b/src/utils/git.ts index ffb0d1d..e96292a 100644 --- a/src/utils/git.ts +++ b/src/utils/git.ts @@ -85,6 +85,12 @@ export async function clone(repo: string, directory: string): Promise { export async function updateSubmodulesRecursive(directory: string): Promise { try { console.log(`Updating submodules in ${directory}`); + + const gifConfigPath = `${directory}/.git/config`; + if (!fs.existsSync(gifConfigPath)) { + await shell.exec(`cd ${directory} ; git submodule update --init --recursive`); + } + const gitConfig = fs.readFileSync(`${directory}/.git/config`, "utf8"); if (!gitConfig.includes("submodule")) {