-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload_code_if_changed.bat
More file actions
49 lines (43 loc) · 1.32 KB
/
Copy pathupload_code_if_changed.bat
File metadata and controls
49 lines (43 loc) · 1.32 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
@echo off
REM Upload changes to StepperGUI and MagLoop_Common_Files
REM Always prompt for commit message before checking for changes
set /p commit_msg=Enter commit message for StepperGUI:
git status --porcelain > temp_status.txt
findstr /r /c:"^.." temp_status.txt >nul
if %errorlevel%==0 (
echo Changes detected in StepperGUI. Pushing to GitHub...
echo Staged files:
git status --short
git add -A
echo After staging:
git status --short
git commit -m "%commit_msg%"
for /f "delims=* " %%b in ('git rev-parse --abbrev-ref HEAD') do set current_branch=%%b
git push origin %current_branch%
) else (
echo No changes to push in StepperGUI.
)
del temp_status.txt
REM Change to submodule directory
cd MagLoop_Common_Files
REM Check for changes in submodule (MagLoop_Common_Files)
git status --porcelain > temp_status.txt
findstr /r /c:"^.." temp_status.txt >nul
if %errorlevel%==0 (
echo Changes detected in MagLoop_Common_Files. Pushing to GitHub...
echo Staged files:
git status --short
git add .
echo After staging:
git status --short
git commit -m "Update MagLoop_Common_Files"
git push origin main
) else (
echo No changes to push in MagLoop_Common_Files.
)
del temp_status.txt
REM Return to main project directory
cd ..
echo.
echo Upload script complete. All done.
pause