From 869e769ec8391bce82e66844d619c00e4256bd7b Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Mon, 20 Feb 2023 04:28:16 -0600 Subject: [PATCH] Trim trailing newlines from `resolvedPyPyVersion` (#610) Fixes #609 --- dist/setup/index.js | 6 +++--- src/find-pypy.ts | 2 +- src/install-pypy.ts | 2 +- src/utils.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 18cc54b..cc4cb8d 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -66283,7 +66283,7 @@ function findPyPyVersion(versionSpec, architecture, updateEnvironment, checkLate core.addPath(pythonLocation); core.addPath(_binDir); } - core.setOutput('python-version', 'pypy' + resolvedPyPyVersion.trim()); + core.setOutput('python-version', 'pypy' + resolvedPyPyVersion); core.setOutput('python-path', pythonPath); return { resolvedPyPyVersion, resolvedPythonVersion }; }); @@ -66699,7 +66699,7 @@ function findRelease(releases, pythonVersion, pypyVersion, architecture, include return { foundAsset, resolvedPythonVersion: foundRelease.python_version, - resolvedPyPyVersion: foundRelease.pypy_version + resolvedPyPyVersion: foundRelease.pypy_version.trim() }; } exports.findRelease = findRelease; @@ -67095,7 +67095,7 @@ function readExactPyPyVersionFile(installDir) { let pypyVersion = ''; let fileVersion = path.join(installDir, PYPY_VERSION_FILE); if (fs_1.default.existsSync(fileVersion)) { - pypyVersion = fs_1.default.readFileSync(fileVersion).toString(); + pypyVersion = fs_1.default.readFileSync(fileVersion).toString().trim(); } return pypyVersion; } diff --git a/src/find-pypy.ts b/src/find-pypy.ts index 44bfd5a..d2fe388 100644 --- a/src/find-pypy.ts +++ b/src/find-pypy.ts @@ -98,7 +98,7 @@ export async function findPyPyVersion( core.addPath(pythonLocation); core.addPath(_binDir); } - core.setOutput('python-version', 'pypy' + resolvedPyPyVersion.trim()); + core.setOutput('python-version', 'pypy' + resolvedPyPyVersion); core.setOutput('python-path', pythonPath); return {resolvedPyPyVersion, resolvedPythonVersion}; diff --git a/src/install-pypy.ts b/src/install-pypy.ts index 9327d62..a7fffa5 100644 --- a/src/install-pypy.ts +++ b/src/install-pypy.ts @@ -233,7 +233,7 @@ export function findRelease( return { foundAsset, resolvedPythonVersion: foundRelease.python_version, - resolvedPyPyVersion: foundRelease.pypy_version + resolvedPyPyVersion: foundRelease.pypy_version.trim() }; } diff --git a/src/utils.ts b/src/utils.ts index fe32eda..c75a7e8 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -73,7 +73,7 @@ export function readExactPyPyVersionFile(installDir: string) { let pypyVersion = ''; let fileVersion = path.join(installDir, PYPY_VERSION_FILE); if (fs.existsSync(fileVersion)) { - pypyVersion = fs.readFileSync(fileVersion).toString(); + pypyVersion = fs.readFileSync(fileVersion).toString().trim(); } return pypyVersion;