aboutsummaryrefslogtreecommitdiff
path: root/install-win.cmd
blob: 007516d5b86405c6fee8e075fb6f2c83cfb5d5e6 (plain)
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
@echo off
setlocal enabledelayedexpansion

rem Windows-natives Pendant zu install.sh.
rem Kopiert (statt zu verlinken) die relevanten Konfigurationen an ihre
rem nativen Windows-Zielorte. install.sh bleibt unveraendert; dieses
rem Skript ist bewusst eigenstaendig, da FreeBSD/macOS und Windows zu
rem unterschiedlich sind fuer eine gemeinsame Installationsroutine.
rem
rem Hinweis: Nach Aenderungen an nvim/ oder git/ dieses Skript erneut
rem ausfuehren, um die Kopien zu aktualisieren (keine Symlinks).

set "SCRIPT_DIR=%~dp0"

set "NVIM_SRC=%SCRIPT_DIR%nvim"
set "NVIM_DST=%LOCALAPPDATA%\nvim"

set "GIT_CONFIG_SRC=%SCRIPT_DIR%git\config"
set "GIT_CONFIG_DST=%USERPROFILE%\.gitconfig"

set "GIT_UP2PARTS_SRC=%SCRIPT_DIR%git\config-up2parts"
set "GIT_XDG_DIR=%USERPROFILE%\.config\git"
set "GIT_UP2PARTS_DST=%GIT_XDG_DIR%\config-up2parts"

set "NPMRC_SRC=%SCRIPT_DIR%npm\npmrc"
set "NPMRC_DST=%USERPROFILE%\.npmrc"

echo === nvim ===
robocopy "%NVIM_SRC%" "%NVIM_DST%" /MIR /NFL /NDL /NJH /NJS >nul
if %ERRORLEVEL% GEQ 8 (
  echo Fehler: nvim-Konfiguration konnte nicht nach "%NVIM_DST%" kopiert werden.
  exit /b 1
)
echo OK: %NVIM_DST%

echo === git ===
copy /Y "%GIT_CONFIG_SRC%" "%GIT_CONFIG_DST%" >nul
if errorlevel 1 (
  echo Fehler: git-Konfiguration konnte nicht nach "%GIT_CONFIG_DST%" kopiert werden.
  exit /b 1
)
echo OK: %GIT_CONFIG_DST%

if not exist "%GIT_XDG_DIR%" mkdir "%GIT_XDG_DIR%"
copy /Y "%GIT_UP2PARTS_SRC%" "%GIT_UP2PARTS_DST%" >nul
if errorlevel 1 (
  echo Fehler: config-up2parts konnte nicht nach "%GIT_UP2PARTS_DST%" kopiert werden.
  exit /b 1
)
echo OK: %GIT_UP2PARTS_DST% ^(wird per includeIf aus .gitconfig eingebunden^)

echo === npm ===
if exist "%NPMRC_DST%" (
  echo Uebersprungen: %NPMRC_DST% existiert bereits.
) else (
  copy /Y "%NPMRC_SRC%" "%NPMRC_DST%" >nul
  echo OK: %NPMRC_DST%
)

echo.
echo Fertig. Dateien wurden KOPIERT, nicht verlinkt.
echo Nach Aenderungen im Repo dieses Skript erneut ausfuehren.

endlocal