Skip to content

Commit

Permalink
fixing issue in updateSubmodulesRecursive
Browse files Browse the repository at this point in the history
  • Loading branch information
pellicceama committed Mar 13, 2023
1 parent 7b6684d commit 4ff0689
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ export async function clone(repo: string, directory: string): Promise<void> {
export async function updateSubmodulesRecursive(directory: string): Promise<void> {
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")) {
Expand Down

0 comments on commit 4ff0689

Please sign in to comment.