Skip to content

Commit 3b3e893

Browse files
committed
fix: trim sdkroot output
1 parent ab471df commit 3b3e893

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

dist/setup_cpp.js

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

dist/setup_cpp.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/macos-sdk/macos-sdk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export async function setupMacOSSDK() {
77
const xcrun = await getExecOutput("xcrun --sdk macosx --show-sdk-path")
88
const sdkroot = xcrun.stdout || xcrun.stderr
99
if (sdkroot) {
10-
core.exportVariable("SDKROOT", sdkroot)
10+
core.exportVariable("SDKROOT", sdkroot.trim())
1111
} else {
1212
core.error(`SDKROOT not set`)
1313
}

src/utils/setup/version.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ export const defaultVersionRegex = /v?(\d\S*)/
5858
/** Get the version of a binary */
5959
export async function getBinVersion(file: string, versionRegex: RegExp = defaultVersionRegex) {
6060
try {
61-
const { stderr, stdout } = await getExecOutput(file, ["--version"])
62-
const version = stdout.match(versionRegex)?.[1] ?? stderr.match(versionRegex)?.[1]
61+
const execout = await getExecOutput(file, ["--version"])
62+
const version_output = execout.stdout || execout.stderr || ""
63+
const version = version_output.trim().match(versionRegex)?.[1]
6364
return version
6465
} catch (e) {
6566
console.error(e)

0 commit comments

Comments
 (0)