mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 13:26:04 -06:00
fix(ci): preserve iOS Fastlane root after cd (#128854)
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# BASH_SOURCE may be relative, so resolve it before callers change directories.
|
||||
_OPENCLAW_IOS_FASTLANE_REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"
|
||||
|
||||
run_ios_fastlane() {
|
||||
local gemfile=""
|
||||
gemfile="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)/apps/ios/Gemfile"
|
||||
gemfile="${_OPENCLAW_IOS_FASTLANE_REPO_ROOT}/apps/ios/Gemfile"
|
||||
|
||||
local setup_hint=""
|
||||
setup_hint="Install Ruby 3.4.10, then run: cd apps/ios && gem install bundler -v 2.6.9 && bundle _2.6.9_ install"
|
||||
|
||||
@@ -156,7 +156,11 @@ describe("iOS release shell wrapper arguments", () => {
|
||||
expect(script).toContain('export GIT_COMMIT="${RELEASE_GIT_COMMIT}"');
|
||||
});
|
||||
|
||||
function runSharedFastlane(options: { fastlaneExit: number; bundleGemfile?: string }) {
|
||||
function runSharedFastlane(options: {
|
||||
fastlaneExit: number;
|
||||
bundleGemfile?: string;
|
||||
changeDirectoryAfterSource?: boolean;
|
||||
}) {
|
||||
const binDir = tempDirs.make("openclaw-fastlane-test-");
|
||||
const bundle = path.join(binDir, "bundle");
|
||||
const fastlane = path.join(binDir, "fastlane");
|
||||
@@ -175,7 +179,12 @@ describe("iOS release shell wrapper arguments", () => {
|
||||
chmodSync(fastlane, 0o755);
|
||||
return spawnSync(
|
||||
BASH_BIN,
|
||||
["-c", "source scripts/lib/ios-fastlane.sh; run_ios_fastlane ios release_plan"],
|
||||
[
|
||||
"-c",
|
||||
options.changeDirectoryAfterSource
|
||||
? "source scripts/lib/ios-fastlane.sh; cd apps/ios; run_ios_fastlane ios release_plan"
|
||||
: "source scripts/lib/ios-fastlane.sh; run_ios_fastlane ios release_plan",
|
||||
],
|
||||
{
|
||||
cwd: process.cwd(),
|
||||
env: {
|
||||
@@ -202,4 +211,14 @@ describe("iOS release shell wrapper arguments", () => {
|
||||
|
||||
expect(result.status).toBe(0);
|
||||
});
|
||||
|
||||
it("keeps the repository Gemfile after the caller changes directories", () => {
|
||||
const result = runSharedFastlane({
|
||||
bundleGemfile: "/tmp/hostile/Gemfile",
|
||||
changeDirectoryAfterSource: true,
|
||||
fastlaneExit: 0,
|
||||
});
|
||||
|
||||
expect(result.status).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user