github.com/nevalang/neva@v0.23.1-0.20240507185603-7696a9bb8dda/scripts/cn/install.bat (about)

     1  @echo off
     2  rem Determine architecture
     3  FOR /F "tokens=2 delims=:," %%F IN ('systeminfo ^| findstr /C:"System Type" ^| findstr x64') DO (
     4      SET ARCH=amd64
     5  )
     6  if not defined ARCH SET ARCH=arm64
     7  
     8  rem Determine the latest release tag
     9  FOR /F "tokens=2 delims=:," %%F IN ('curl -s https://api.github.com/repos/nevalang/neva/releases/latest ^| findstr /C:"\"tag_name\""' ) DO (
    10      SET LATEST_TAG=%%~F
    11  )
    12  set LATEST_TAG=%LATEST_TAG:"=%
    13  set "LATEST_TAG=%LATEST_TAG: =%"
    14  
    15  rem Build the release url
    16  set  BIN_NAME=neva
    17  set "BIN_URL=https://github.com/nevalang/neva/releases/download/%LATEST_TAG%/%BIN_NAME%-windows-%ARCH%.exe"
    18  ECHO Downloading...
    19  
    20  rem Download the binary
    21  curl -L %BIN_URL% -o %BIN_NAME%.exe > NUL 2>&1
    22  
    23  rem Move the binary to a location in the user's path
    24  set "destination_path=C:\Windows"
    25  move %BIN_NAME%.exe %destination_path%
    26  Echo Installed successfully