Skip to content

Commit

Permalink
Merge pull request open-telemetry#166 from MSNev/MSNev/AddComponents
Browse files Browse the repository at this point in the history
fix: handle re-adding submodule to the index
  • Loading branch information
MSNev committed Aug 16, 2023
2 parents cc4ac29 + ed81e3e commit ff8c194
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sandbox-tools/merge-repos/src/mergeStagingToMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -993,8 +993,14 @@ async function mergeStagingToMaster(mergeGit: SimpleGit, stagingDetails: IStagin

log ("Resetting up submodules");
for (let lp = 0; lp < _subModules.length; lp++) {
log ("adding submodule " + _subModules[lp].path + " => " + _subModules[lp].url);
await mergeGit.submoduleAdd(_subModules[lp].url, _subModules[lp].path);
try {
log ("adding submodule " + _subModules[lp].path + " => " + _subModules[lp].url);
await mergeGit.submoduleAdd(_subModules[lp].url, _subModules[lp].path);
} catch (e) {
if (e.message.indexOf("already exists") === -1) {
throw e;
}
}
}

// Update the root package json
Expand Down

0 comments on commit ff8c194

Please sign in to comment.