Repository navigation
Expand file tree
/
Copy pathpublish.bat
More file actions
50 lines (45 loc) · 2.55 KB
/
Copy pathpublish.bat
File metadata and controls
50 lines (45 loc) · 2.55 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 (c) 2026 Roy Borkin. All rights reserved. See LICENSE.
rem Publish safely: check this folder for keys and personal data, then copy it into your git clone
rem (the public GitHub repo) without the private files, and show `git status`. Nothing is committed or pushed.
rem publish.bat → copies into ..\RoundSpotify (the clone next to this folder)
rem publish.bat "C:\path\to\clone" → another clone
rem Your own IPs, network names and IDs: tools\private-patterns.json (copy tools\private-patterns.example.json).
setlocal
set "SRC=%~dp0"
if "%SRC:~-1%"=="\" set "SRC=%SRC:~0,-1%"
set "DEST=%~1"
if "%DEST%"=="" set "DEST=%SRC%\..\RoundSpotify"
for %%I in ("%DEST%") do set "DEST=%%~fI"
where node >nul 2>nul || (echo node is not installed - get it from https://nodejs.org & exit /b 1)
if not exist "%DEST%\.git" (
echo "%DEST%" is not a git clone - give the clone's folder: publish.bat "C:\path\to\RoundSpotify"
exit /b 1
)
echo === 1/3 Checking %SRC% for keys and personal data
node "%SRC%\tools\check-public.mjs" "%SRC%"
if errorlevel 1 ( echo. & echo STOPPED - nothing was copied. & exit /b 1 )
echo === 2/3 Copying into %DEST%
rem /MIR mirrors (files deleted here are deleted there too); excluded files and folders are left alone on both sides.
robocopy "%SRC%" "%DEST%" /MIR /NFL /NDL /NJH /NP ^
/XD .git node_modules "%SRC%\data" "%SRC%\profiles" "%SRC%\cache" "%SRC%\bridge\profiles" "%SRC%\bridge\cache" ^
"%SRC%\games examples" "%SRC%\Rush Hour" "%SRC%\Theme UI Examples" ^
/XF .rr_md5.txt .DS_Store .env "%SRC%\tools\private-patterns.json" "%SRC%\bridge\package-lock.json" ^
*.p8 *.tmp *.bad ^
"%SRC%\bridge\config.json" "%SRC%\bridge\psn.json" "%SRC%\bridge\steam.json" "%SRC%\bridge\googlehome.json" ^
"%SRC%\bridge\youtube-tv.json" "%SRC%\bridge\androidtv.json" "%SRC%\bridge\appletv.json" "%SRC%\bridge\streamsdk.json" ^
"%SRC%\bridge\roon-state.json" "%SRC%\bridge\tasks.json" "%SRC%\bridge\collection.json" "%SRC%\bridge\blanks.json" ^
"%SRC%\bridge\system-state.json" "%SRC%\bridge\companion.json"
if errorlevel 8 ( echo robocopy failed & exit /b 1 )
echo === 3/3 Checking the copy
if exist "%SRC%\tools\private-patterns.json" (
node "%SRC%\tools\check-public.mjs" "%DEST%" --patterns "%SRC%\tools\private-patterns.json"
) else (
node "%SRC%\tools\check-public.mjs" "%DEST%"
)
if errorlevel 1 ( echo. & echo The copy has problems - fix them before you commit. & exit /b 1 )
echo.
git -C "%DEST%" status --short
echo.
echo Done. Review the changes above, then commit and push from "%DEST%".
endlocal