You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-06-20 09:19:27 +02:00
52 lines
1.4 KiB
Batchfile
Vendored
52 lines
1.4 KiB
Batchfile
Vendored
@echo off
|
|
setlocal
|
|
|
|
set "SCRIPT_DIR=%~dp0"
|
|
set "PRIMARY_SOURCE=%SCRIPT_DIR%..\..\..\OpenIntegrations-Courses"
|
|
set "FALLBACK_SOURCE=%SCRIPT_DIR%..\..\OpenIntegrations-Courses"
|
|
set "SOURCE_DIR="
|
|
|
|
if exist "%PRIMARY_SOURCE%\" (
|
|
set "SOURCE_DIR=%PRIMARY_SOURCE%"
|
|
) else (
|
|
if exist "%FALLBACK_SOURCE%\" (
|
|
set "SOURCE_DIR=%FALLBACK_SOURCE%"
|
|
)
|
|
)
|
|
|
|
if not exist "%SOURCE_DIR%\" (
|
|
echo [ERROR] Source repo not found.
|
|
echo Tried:
|
|
echo "%PRIMARY_SOURCE%"
|
|
echo "%FALLBACK_SOURCE%"
|
|
echo Clone OpenIntegrations-Courses into repository root and retry.
|
|
exit /b 1
|
|
)
|
|
|
|
echo Syncing course content from "%SOURCE_DIR%"
|
|
|
|
if not exist "%SCRIPT_DIR%courses" mkdir "%SCRIPT_DIR%courses"
|
|
if not exist "%SCRIPT_DIR%data" mkdir "%SCRIPT_DIR%data"
|
|
if not exist "%SCRIPT_DIR%src\pages" mkdir "%SCRIPT_DIR%src\pages"
|
|
|
|
robocopy "%SOURCE_DIR%\courses" "%SCRIPT_DIR%courses" /MIR /NFL /NDL /NJH /NJS /NP
|
|
if %ERRORLEVEL% GEQ 8 (
|
|
echo [ERROR] Failed to sync courses directory.
|
|
exit /b %ERRORLEVEL%
|
|
)
|
|
|
|
robocopy "%SOURCE_DIR%\data" "%SCRIPT_DIR%data" courses.json /NFL /NDL /NJH /NJS /NP
|
|
if %ERRORLEVEL% GEQ 8 (
|
|
echo [ERROR] Failed to sync courses data file.
|
|
exit /b %ERRORLEVEL%
|
|
)
|
|
|
|
robocopy "%SOURCE_DIR%\src\pages" "%SCRIPT_DIR%src\pages" courses.js courses.module.css /NFL /NDL /NJH /NJS /NP
|
|
if %ERRORLEVEL% GEQ 8 (
|
|
echo [ERROR] Failed to sync courses page files.
|
|
exit /b %ERRORLEVEL%
|
|
)
|
|
|
|
echo Courses sync completed.
|
|
exit /b 0
|