-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.cmd
More file actions
50 lines (40 loc) · 1.67 KB
/
install.cmd
File metadata and controls
50 lines (40 loc) · 1.67 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
@echo off
rem ╔═══════════════════════════════════════════════════════════════╗
rem ║ install-bld.cmd - copy the bld tool, but keep Tasks.java ║
rem ╚═══════════════════════════════════════════════════════════════╝
setlocal EnableExtensions
rem ── 1. Check that exactly one argument (destination dir) was given
if "%~2" neq "" (
echo Usage: %~nx0 ^<path-to-install-dir^>
exit /b 1
)
if "%~1"=="" (
echo Usage: %~nx0 ^<path-to-install-dir^>
exit /b 1
)
set "DEST=%~1"
set "SRC=%~dp0" rem directory where this script lives
set "SRC_BUILDER=%SRC%builder"
set "DEST_BUILDER=%DEST%\builder"
rem ── 2. Prepare destination
mkdir "%DEST_BUILDER%" 2>NUL
rem ── 3. Remove *.jar in the source builder folder (matches Bash behaviour)
del "%DEST_BUILDER%\*.jar" 2>NUL
rem ── 4. Copy everything EXCEPT Tasks.java, always overwriting
for %%F in ("%SRC_BUILDER%\*") do (
if /I not "%%~nxF"=="Tasks.java" (
copy /Y "%%~F" "%DEST_BUILDER%\" >NUL
)
)
rem ── 5. Copy Tasks.java only if it’s not already there
if not exist "%DEST_BUILDER%\Tasks.java" (
copy /Y "%SRC_BUILDER%\Tasks.java" "%DEST_BUILDER%\" >NUL
) else (
echo Keeping existing "%DEST_BUILDER%\Tasks.java"
)
del "%DEST_BUILDER%\*.class" 2>NUL
rem ── 6. Copy the wrapper scripts
copy /Y "%SRC%bld" "%DEST%" >NUL
copy /Y "%SRC%bld.cmd" "%DEST%" >NUL
echo Installation complete -> %DEST%
endlocal