From 0debf8f5a8b805fc6e7e4adf11501776fb7fa17d Mon Sep 17 00:00:00 2001
From: CNOCTAVE <cnoctave@qq.com>
Date: Mon, 6 Jan 2025 13:43:03 +0800
Subject: [PATCH] Update index.js

---
 dist/setup/index.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dist/setup/index.js b/dist/setup/index.js
index f940f83b..4b0c76ba 100644
--- a/dist/setup/index.js
+++ b/dist/setup/index.js
@@ -93715,7 +93715,7 @@ class BasePrereleaseNodejs extends base_distribution_1.default {
         let toolPath = '';
         let nodeInstallationPath = core.getInput('node-installation-path');
         if (os_1.default.platform() != 'win32') {
-            nodeInstallationPath = nodeInstallationPath.replace(/\\?bin$/, '');
+            nodeInstallationPath = nodeInstallationPath.replace(/\\bin$/, '').replace(/\/bin$/, '');
         }
         const localVersionPaths = tc
             .findAllVersions('node', this.nodeInfo.arch)
@@ -93996,7 +93996,7 @@ class BaseDistribution {
             info = info || {}; // satisfy compiler, never null when reaches here
             let nodeInstallationPath = core.getInput('node-installation-path');
             if (this.osPlat != 'win32') {
-                nodeInstallationPath = nodeInstallationPath.replace(/\\?bin$/, '');
+                nodeInstallationPath = nodeInstallationPath.replace(/\\bin$/, '').replace(/\/bin$/, '');
             }
             if (this.osPlat == 'win32') {
                 const extension = this.nodeInfo.arch === 'arm64' ? '.zip' : '.7z';