From 38052f947582dce0b901e98a292e3d438ab5abcc Mon Sep 17 00:00:00 2001 From: Josh Willox Date: Sun, 24 Nov 2024 18:41:43 +1100 Subject: [PATCH] fix: cloud-sql-proxy preset on windows --- src/main.ts | 5 +++++ src/presets/index.ts | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index 99caaea..6768c49 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,9 +11,14 @@ export async function main() { try { const templateArgs = { os: process.platform === "win32" ? "windows" : process.platform, + platform: process.platform, arch: process.arch === "x64" ? "amd64" : process.arch, arch2: process.arch, exe: process.platform === "win32" ? ".exe" : "", + exeOsArch: + process.platform === "win32" + ? `${process.arch}.exe` + : `${process.platform}${process.arch === "x64" ? "amd64" : process.arch}`, archive: process.platform === "win32" ? "zip" : "tar.gz", }; diff --git a/src/presets/index.ts b/src/presets/index.ts index ed43907..0e75ef1 100644 --- a/src/presets/index.ts +++ b/src/presets/index.ts @@ -9,12 +9,11 @@ const presets: Record> = { "cloud-sql-proxy": { repo: "GoogleCloudPlatform/cloudsql-proxy", downloadUrl: - "https://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/v{{version}}/cloud-sql-proxy.{{os}}.{{arch}}", - downloadName: "cloud-sql-proxy", + "https://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/v{{version}}/cloud-sql-proxy.{{exeOsArch}}", + downloadName: "cloud-sql-proxy{{exe}}", }, "github-cli": { repo: "cli/cli", - version: "2.62.0", downloadUrl: "/releases/download/v{{version}}/gh_{{version}}_{{os}}_{{arch}}.{{archive}}", binPath: "/gh_{{version}}_{{os}}_{{arch}}/bin",