返回 CodeWhale
install.bat
根目录 / scripts / release / install.bat
1 @echo off
2 setlocal enabledelayedexpansion
3 :: CodeWhale Windows installer
4 :: Copies codewhale.exe, codew.exe, and codewhale-tui.exe to %USERPROFILE%\bin
5
6 set "BIN_DIR=%USERPROFILE%\bin"
7 set "SCRIPT_DIR=%~dp0"
8
9 if not exist "%BIN_DIR%" mkdir "%BIN_DIR%"
10
11 echo Installing codewhale to %BIN_DIR%...
12
13 copy /Y "%SCRIPT_DIR%codewhale.exe" "%BIN_DIR%\codewhale.exe" >nul
14 if %ERRORLEVEL% neq 0 (
15 echo ERROR: Failed to copy codewhale.exe
16 exit /b 1
17 )
18
19 copy /Y "%SCRIPT_DIR%codew.exe" "%BIN_DIR%\codew.exe" >nul
20 if %ERRORLEVEL% neq 0 (
21 echo ERROR: Failed to copy codew.exe
22 exit /b 1
23 )
24
25 copy /Y "%SCRIPT_DIR%codewhale-tui.exe" "%BIN_DIR%\codewhale-tui.exe" >nul
26 if %ERRORLEVEL% neq 0 (
27 echo ERROR: Failed to copy codewhale-tui.exe
28 exit /b 1
29 )
30
31 echo.
32 echo Done. Commands installed to %BIN_DIR%.
33 echo.
34 echo Add %BIN_DIR% to your PATH:
35 echo 1. Open Start, search "environment variables"
36 echo 2. Click "Environment Variables..."
37 echo 3. Under "User variables", select "Path" and click "Edit"
38 echo 4. Click "New" and add: %BIN_DIR%
39 echo 5. Click OK, then restart your terminal
40 echo.
41 echo Or run this in an admin PowerShell:
42 echo [Environment]::SetEnvironmentVariable('Path', [Environment]::GetEnvironmentVariable('Path', 'User') + ';%BIN_DIR%', 'User')
43 echo.
44 echo Then run: codewhale
45
45 lines Plain Text