-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bat
More file actions
118 lines (105 loc) · 3 KB
/
install.bat
File metadata and controls
118 lines (105 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
@echo off
REM =============================================================================
REM SQLite Explorer - Install Script (Windows)
REM =============================================================================
REM This script builds and installs the SQLite Explorer extension to VS Code.
REM
REM Usage:
REM install.bat - Build and install
REM install.bat --clean - Clean, build, and install
REM install.bat --skip-build - Install existing .vsix without rebuilding
REM =============================================================================
setlocal enabledelayedexpansion
cd /d "%~dp0"
REM Get version from package.json
for /f "tokens=*" %%i in ('node -p "require('./package.json').version"') do set EXT_VERSION=%%i
set EXT_NAME=sqlite-explorer
set VSIX_FILE=%EXT_NAME%-%EXT_VERSION%.vsix
echo =================================
echo SQLite Explorer Installer
echo Version: %EXT_VERSION%
echo =================================
echo.
REM Parse arguments
set CLEAN=false
set SKIP_BUILD=false
:parse_args
if "%~1"=="" goto end_parse
if "%~1"=="--clean" set CLEAN=true
if "%~1"=="--skip-build" set SKIP_BUILD=true
if "%~1"=="--help" goto show_help
if "%~1"=="-h" goto show_help
shift
goto parse_args
:end_parse
REM Check for VS Code
where code >nul 2>&1
if %errorlevel% equ 0 (
set VSCODE_CMD=code
goto found_vscode
)
where code-insiders >nul 2>&1
if %errorlevel% equ 0 (
set VSCODE_CMD=code-insiders
goto found_vscode
)
echo Error: VS Code CLI not found
echo Make sure VS Code is installed and 'code' is in your PATH
exit /b 1
:found_vscode
echo Using: %VSCODE_CMD%
REM Clean if requested
if "%CLEAN%"=="true" (
echo.
echo Cleaning build artifacts...
if exist out rmdir /s /q out
if exist assets rmdir /s /q assets
del /q *.vsix 2>nul
echo Clean complete
)
REM Build unless skipped
if "%SKIP_BUILD%"=="false" (
echo.
echo Building extension...
call node scripts/build.mjs
if %errorlevel% neq 0 (
echo Build failed!
exit /b 1
)
echo Build complete
echo.
echo Packaging extension...
call npx vsce package --skip-license --out "%VSIX_FILE%"
if %errorlevel% neq 0 (
echo Packaging failed!
exit /b 1
)
echo Package complete: %VSIX_FILE%
) else (
if not exist "%VSIX_FILE%" (
echo Error: %VSIX_FILE% not found. Run without --skip-build first.
exit /b 1
)
echo Using existing package: %VSIX_FILE%
)
REM Install
echo.
echo Installing extension to VS Code...
%VSCODE_CMD% --install-extension "%VSIX_FILE%" --force
echo.
echo =================================
echo Installation Complete!
echo =================================
echo.
echo Reload VS Code to activate the extension:
echo Ctrl+Shift+P then Developer: Reload Window
echo.
exit /b 0
:show_help
echo Usage: install.bat [OPTIONS]
echo.
echo Options:
echo --clean Clean build artifacts before building
echo --skip-build Skip build step, install existing .vsix
echo --help, -h Show this help message
exit /b 0