Skip to content

Commit f2c3865

Browse files
read correct file
1 parent 7d1e3ad commit f2c3865

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

dist/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58088,19 +58088,20 @@ async function GetProjectDetails(credential, xcodeVersion) {
5808858088
return projectRef;
5808958089
}
5809058090
async function parseBuildSettings(projectPath) {
58091-
await fs.promises.access(projectPath, fs.constants.R_OK);
58092-
const xCodeProjContent = await fs.promises.readFile(projectPath, 'utf8');
58093-
const platformName = core.getInput('platform') || matchRegexPattern(xCodeProjContent, /\s+PLATFORM_NAME = (?<platformName>\w+)/, 'platformName');
58091+
const projectFilePath = `${projectPath}/project.pbxproj`;
58092+
await fs.promises.access(projectFilePath, fs.constants.R_OK);
58093+
const content = await fs.promises.readFile(projectFilePath, 'utf8');
58094+
const platformName = core.getInput('platform') || matchRegexPattern(content, /\s+PLATFORM_NAME = (?<platformName>\w+)/, 'platformName');
5809458095
if (!platformName) {
5809558096
throw new Error('Unable to determine the platform name from the build settings');
5809658097
}
58097-
const bundleId = core.getInput('bundle-id') || matchRegexPattern(xCodeProjContent, /\s+PRODUCT_BUNDLE_IDENTIFIER = (?<bundleId>[\w.-]+)/, 'bundleId');
58098+
const bundleId = core.getInput('bundle-id') || matchRegexPattern(content, /\s+PRODUCT_BUNDLE_IDENTIFIER = (?<bundleId>[\w.-]+)/, 'bundleId');
5809858099
if (!bundleId || bundleId === 'NO') {
5809958100
throw new Error('Unable to determine the bundle ID from the build settings');
5810058101
}
5810158102
let platformSdkVersion = core.getInput('platform-sdk-version') || null;
5810258103
if (!platformSdkVersion) {
58103-
platformSdkVersion = matchRegexPattern(xCodeProjContent, /\s+SDK_VERSION = (?<sdkVersion>[\d.]+)/, 'sdkVersion') || null;
58104+
platformSdkVersion = matchRegexPattern(content, /\s+SDK_VERSION = (?<sdkVersion>[\d.]+)/, 'sdkVersion') || null;
5810458105
}
5810558106
const platforms = {
5810658107
'iphoneos': 'iOS',

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/xcode.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,20 @@ export async function GetProjectDetails(credential: AppleCredential, xcodeVersio
120120
}
121121

122122
async function parseBuildSettings(projectPath: string): Promise<[string, string]> {
123-
await fs.promises.access(projectPath, fs.constants.R_OK);
124-
const xCodeProjContent = await fs.promises.readFile(projectPath, 'utf8');
125-
const platformName = core.getInput('platform') || matchRegexPattern(xCodeProjContent, /\s+PLATFORM_NAME = (?<platformName>\w+)/, 'platformName');
123+
const projectFilePath = `${projectPath}/project.pbxproj`;
124+
await fs.promises.access(projectFilePath, fs.constants.R_OK);
125+
const content = await fs.promises.readFile(projectFilePath, 'utf8');
126+
const platformName = core.getInput('platform') || matchRegexPattern(content, /\s+PLATFORM_NAME = (?<platformName>\w+)/, 'platformName');
126127
if (!platformName) {
127128
throw new Error('Unable to determine the platform name from the build settings');
128129
}
129-
const bundleId = core.getInput('bundle-id') || matchRegexPattern(xCodeProjContent, /\s+PRODUCT_BUNDLE_IDENTIFIER = (?<bundleId>[\w.-]+)/, 'bundleId');
130+
const bundleId = core.getInput('bundle-id') || matchRegexPattern(content, /\s+PRODUCT_BUNDLE_IDENTIFIER = (?<bundleId>[\w.-]+)/, 'bundleId');
130131
if (!bundleId || bundleId === 'NO') {
131132
throw new Error('Unable to determine the bundle ID from the build settings');
132133
}
133134
let platformSdkVersion = core.getInput('platform-sdk-version') || null;
134135
if (!platformSdkVersion) {
135-
platformSdkVersion = matchRegexPattern(xCodeProjContent, /\s+SDK_VERSION = (?<sdkVersion>[\d.]+)/, 'sdkVersion') || null;
136+
platformSdkVersion = matchRegexPattern(content, /\s+SDK_VERSION = (?<sdkVersion>[\d.]+)/, 'sdkVersion') || null;
136137
}
137138
const platforms = {
138139
'iphoneos': 'iOS',

0 commit comments

Comments
 (0)