-
Notifications
You must be signed in to change notification settings - Fork 1
/
save.bat
52 lines (43 loc) · 1.02 KB
/
save.bat
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
@ECHO OFF
SETLOCAL
REM Check for commit message argument
IF "%~1"=="" (
ECHO No commit message provided, using default.
SET "COMMIT_MSG=end of day auto-commit"
) ELSE (
SET "COMMIT_MSG=%~1"
)
REM Perform git operations
CALL :git_ops_app "%COMMIT_MSG%"
IF ERRORLEVEL 1 (
ECHO Git operations failed.
EXIT /B 1
)
CD /D "functions"
CALL :git_ops_functions "functions: %COMMIT_MSG%" "functions"
IF ERRORLEVEL 1 (
ECHO Git operations for 'functions' failed.
EXIT /B 1
)
REM Perform flutter and firebase operations
ECHO Operations completed successfully.
EXIT /B 0
REM A subroutine to perform git operations
:git_ops_app
CALL git add .
IF ERRORLEVEL 1 EXIT /B 1
CALL git commit -m "%~1"
IF ERRORLEVEL 1 EXIT /B 1
CALL git push -u origin master
IF ERRORLEVEL 1 EXIT /B 1
CALL git push -u dorg master
IF ERRORLEVEL 1 EXIT /B 1
EXIT /B 0
:git_ops_functions
CALL git add .
IF ERRORLEVEL 1 EXIT /B 1
CALL git commit -m "%~1"
IF ERRORLEVEL 1 EXIT /B 1
CALL git push -u origin master
IF ERRORLEVEL 1 EXIT /B 1
EXIT /B 0