Skip to content

Commit c39cc02

Browse files
committed
Add --ignore-dependencies to make it work on hosted images
1 parent 45da512 commit c39cc02

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

__tests__/installer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("CocoapodsInstaller", () => {
1919
it("replace existing version", async () => {
2020
CocoapodsInstaller["getInstalledVersion"] = jest.fn().mockReturnValue("1.8.5");
2121
await CocoapodsInstaller.install("1.9.1");
22-
expect(execCommandSpy).toHaveBeenCalledWith("gem", ["uninstall", "cocoapods", expect.any(String), expect.any(String)]);
22+
expect(execCommandSpy).toHaveBeenCalledWith("gem", ["uninstall", "cocoapods", expect.any(String), expect.any(String), expect.any(String)]);
2323
expect(execCommandSpy).toHaveBeenCalledWith("gem", ["install", "cocoapods", expect.any(String), expect.any(String), expect.any(String)]);
2424
});
2525

__tests__/podfile-parser.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ describe("getVersionFromPodfile", () => {
66
["Podfile.lock", "1.5.3"],
77
["Podfile2.lock", "1.9.3"],
88
["Podfile3.lock", "1.10.0.rc.1"],
9-
["Podfile4.lock", "1.9.0.beta.2"],
10-
["Podfile5.lock", null]
9+
["Podfile4.lock", "1.9.0.beta.2"]
1110
])("test case %#", (input: string, expected: string | null) => {
1211
const testCasePath = path.resolve(path.join(__dirname, "podfile-example", input));
13-
if (expected) {
14-
expect(getVersionFromPodfile(testCasePath)).toBe(expected);
15-
} else {
16-
expect(() => getVersionFromPodfile(testCasePath)).toThrow();
17-
}
12+
expect(getVersionFromPodfile(testCasePath)).toBe(expected);
13+
});
14+
15+
it("fails on invalid podfile", () => {
16+
const testCasePath = path.resolve(path.join(__dirname, "podfile-example", "Podfile5.lock"));
17+
expect(() => getVersionFromPodfile(testCasePath)).toThrow();
1818
});
1919
});
2020

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CocoapodsInstaller {
4242
return;
4343
}
4444
// Remove pre-installed version of Cocoapods
45-
exec.exec("gem", ["uninstall", "cocoapods", "--all", "--executables"]);
45+
exec.exec("gem", ["uninstall", "cocoapods", "--all", "--executables", "--ignore-dependencies"]);
4646
// Install new version of Cocoapods
4747
const versionArguments = (versionSpec === "latest") ? [] : ["-v", versionSpec];
4848
await exec.exec("gem", ["install", "cocoapods", ...versionArguments, "--no-document"]);

src/installer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class CocoapodsInstaller {
1212
}
1313

1414
// Remove pre-installed version of Cocoapods
15-
exec.exec("gem", ["uninstall", "cocoapods", "--all", "--executables"]);
15+
exec.exec("gem", ["uninstall", "cocoapods", "--all", "--executables", "--ignore-dependencies"]);
1616

1717
// Install new version of Cocoapods
1818
const versionArguments = (versionSpec === "latest") ? [] : ["-v", versionSpec];

0 commit comments

Comments
 (0)