setup-sdl: Avoid backslashes in PKG_CONFIG_PATH and SDL2_CONFIG

From f7ede4d01e17c2866aa2b195cc2fce5b111176aa Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Fri, 30 Jun 2023 22:59:47 +0200
Subject: [PATCH] Avoid backslashes in PKG_CONFIG_PATH and SDL2_CONFIG

---
 packed/index.js     | 8 ++------
 src/main.ts         | 8 ++------
 src/version.test.ts | 1 -
 3 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/packed/index.js b/packed/index.js
index 7879447..3429f2c 100644
--- a/packed/index.js
+++ b/packed/index.js
@@ -511,15 +511,11 @@ function run() {
                     else {
                         pkg_config_path = "";
                     }
-                    pkg_config_path += path
-                        .join(PACKAGE_DIR, "lib", "pkgconfig")
-                        .replace("\\", "/");
+                    pkg_config_path += [PACKAGE_DIR, "lib", "pkgconfig"].join("/");
                     core.exportVariable("PKG_CONFIG_PATH", pkg_config_path);
                     // Set SDL2_CONFIG environment variable
                     if (SDL_VERSION.major == 2) {
-                        sdl2_config = path
-                            .join(PACKAGE_DIR, "bin", "sdl2-config")
-                            .replace("\\", "/");
+                        sdl2_config = [PACKAGE_DIR, "bin", "sdl2-config"].join("/");
                         core.exportVariable("SDL2_CONFIG", sdl2_config);
                     }
                     core.exportVariable("SDL".concat(SDL_VERSION.major, "_ROOT"), PACKAGE_DIR);
diff --git a/src/main.ts b/src/main.ts
index 2dec775..4128d1b 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -425,16 +425,12 @@ async function run() {
   } else {
     pkg_config_path = "";
   }
-  pkg_config_path += path
-    .join(PACKAGE_DIR, "lib", "pkgconfig")
-    .replace("\\", "/");
+  pkg_config_path += [PACKAGE_DIR, "lib", "pkgconfig"].join("/");
   core.exportVariable("PKG_CONFIG_PATH", pkg_config_path);
 
   // Set SDL2_CONFIG environment variable
   if (SDL_VERSION.major == 2) {
-    const sdl2_config = path
-      .join(PACKAGE_DIR, "bin", "sdl2-config")
-      .replace("\\", "/");
+    const sdl2_config = [PACKAGE_DIR, "bin", "sdl2-config"].join("/");
     core.exportVariable(`SDL2_CONFIG`, sdl2_config);
   }
 
diff --git a/src/version.test.ts b/src/version.test.ts
index a58b308..be2acba 100644
--- a/src/version.test.ts
+++ b/src/version.test.ts
@@ -2,7 +2,6 @@ import {
   GitHubRelease,
   parse_requested_sdl_version,
   SdlVersion,
-  SdlRelease,
   SdlReleaseDb,
   SdlReleaseType,
 } from "./version";