Просмотр исходного кода

Reference the actual name of the windows package (#1700)

Clayton 6 месяцев назад
Родитель
Сommit
9b6ef074f0
2 измененных файлов с 3 добавлено и 3 удалено
  1. 1 1
      packages/opencode/bin/opencode.cmd
  2. 2 2
      packages/opencode/script/postinstall.mjs

+ 1 - 1
packages/opencode/bin/opencode.cmd

@@ -11,7 +11,7 @@ set "script_dir=%~dp0"
 set "script_dir=%script_dir:~0,-1%"
 set "script_dir=%script_dir:~0,-1%"
 
 
 rem Detect platform and architecture
 rem Detect platform and architecture
-set "platform=win32"
+set "platform=windows"
 
 
 rem Detect architecture
 rem Detect architecture
 if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
 if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (

+ 2 - 2
packages/opencode/script/postinstall.mjs

@@ -20,7 +20,7 @@ function detectPlatformAndArch() {
       platform = "linux"
       platform = "linux"
       break
       break
     case "win32":
     case "win32":
-      platform = "win32"
+      platform = "windows"
       break
       break
     default:
     default:
       platform = os.platform()
       platform = os.platform()
@@ -50,7 +50,7 @@ function detectPlatformAndArch() {
 function findBinary() {
 function findBinary() {
   const { platform, arch } = detectPlatformAndArch()
   const { platform, arch } = detectPlatformAndArch()
   const packageName = `opencode-${platform}-${arch}`
   const packageName = `opencode-${platform}-${arch}`
-  const binary = platform === "win32" ? "opencode.exe" : "opencode"
+  const binary = platform === "windows" ? "opencode.exe" : "opencode"
 
 
   try {
   try {
     // Use require.resolve to find the package
     // Use require.resolve to find the package