mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +00:00
fix(ioscompanion): resolve signing key path to absolute
xcodebuild's -authenticationKeyPath requires an absolute path, but .env files commonly carry a repo-relative one. Resolve it against the working directory before the stat so a relative ASC_API_KEY_PATH still signs.
This commit is contained in:
1 parent
0e76e2e474
commit
1357a2b1cc
2 files changed
+27
-4
No files matched your search
@@ -67,10 +67,14 @@ func readSigningCredentials() (signingCredentials, error) {
|
||||
if len(missing) > 0 {
|
||||
return creds, fmt.Errorf("device signing requires environment variables: %s", strings.Join(missing, ", "))
|
||||
}
|
||||
if creds.authKeyPath != "" {
|
||||
if _, err := os.Stat(creds.authKeyPath); err != nil {
|
||||
return creds, fmt.Errorf("App Store Connect key not found at %s: %w", creds.authKeyPath, err)
|
||||
}
|
||||
// xcodebuild's -authenticationKeyPath demands an absolute path, but .env
|
||||
// files commonly carry a repo-relative one. Resolve it against the working
|
||||
// directory before the stat so a relative key still works.
|
||||
if absolute, err := filepath.Abs(creds.authKeyPath); err == nil {
|
||||
creds.authKeyPath = absolute
|
||||
}
|
||||
if _, err := os.Stat(creds.authKeyPath); err != nil {
|
||||
return creds, fmt.Errorf("App Store Connect key not found at %s: %w", creds.authKeyPath, err)
|
||||
}
|
||||
return creds, nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user