Skip to content

Commit 71b7db2

Browse files
authored
Merge pull request nodegit#1558 from implausible/feature/sequence-submodule-updates
Run submodule updates in sequence rather than parallel
2 parents 722a3b6 + 14b20e5 commit 71b7db2

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

lifecycleScripts/submodules/index.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,22 @@ module.exports = function submodules() {
6161
console.warn("\nThey will not be updated.");
6262
}
6363

64-
return Promise.all(statuses
64+
return statuses
6565
.filter(function(status) {
6666
return !status.onNewCommit;
6767
})
68-
.map(function(submoduleToUpdate) {
69-
console.log("[nodegit] Initializing submodules");
70-
71-
return exec(
72-
"git submodule update --init --recursive " + submoduleToUpdate.name
73-
);
74-
})
75-
);
68+
.reduce(function(chainPromise, submoduleToUpdate) {
69+
return chainPromise
70+
.then(function() {
71+
console.log(
72+
"[nodegit] Initializing submodule",
73+
submoduleToUpdate.name
74+
);
75+
return exec(
76+
"git submodule update --init --recursive " +
77+
submoduleToUpdate.name
78+
);
79+
});
80+
}, Promise.resolve());
7681
});
7782
};

0 commit comments

Comments
 (0)