diff --git a/plugins/cocoapods/__tests__/cocoapods.test.ts b/plugins/cocoapods/__tests__/cocoapods.test.ts index bd25574b6..adf547468 100644 --- a/plugins/cocoapods/__tests__/cocoapods.test.ts +++ b/plugins/cocoapods/__tests__/cocoapods.test.ts @@ -672,6 +672,7 @@ describe("Cocoapods Plugin", () => { expect(versions).toContain("1.0.0-next.0"); expect(exec).toBeCalledTimes(6); expect(exec).toHaveBeenCalledWith("git", ["checkout", "./Test.podspec"]); + expect(exec).toHaveBeenCalledWith("git", ["checkout", "./Test2.podspec"]); expect(mock).toBeCalledTimes(2); expect(mock).toHaveBeenCalledWith( diff --git a/plugins/cocoapods/src/index.ts b/plugins/cocoapods/src/index.ts index 7bb887328..1425ac3a5 100644 --- a/plugins/cocoapods/src/index.ts +++ b/plugins/cocoapods/src/index.ts @@ -352,8 +352,12 @@ export default class CocoapodsPlugin implements IPlugin { await this.publishPodSpec(podLogLevel); // Reset changes to podspec file since it doesn't need to be committed - await Promise.all( - this.paths.map((path) => execPromise("git", ["checkout", path])) + await this.paths.reduce( + (promise, path) => + promise.then(async () => { + await execPromise("git", ["checkout", path]); + }), + Promise.resolve() ); return preReleaseVersions;