-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpub.bat
More file actions
53 lines (45 loc) · 854 Bytes
/
pub.bat
File metadata and controls
53 lines (45 loc) · 854 Bytes
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
@echo off
setlocal enabledelayedexpansion
:: Initialize variables
set "commitMessage="
set "tagName="
set "remoteName="
:: Parse named parameters
:parse
if "%~1"=="" goto validate
if "%~1"=="-m" (
set "commitMessage=%~2"
shift
)
if "%~1"=="-t" (
set "tagName=%~2"
shift
)
if "%~1"=="-r" (
set "remoteName=%~2"
shift
)
shift
goto parse
:: Validate required parameters
:validate
if "%commitMessage%"=="" (
echo Error: Missing commit message. Use -m "message"
exit /b 1
)
if "%tagName%"=="" (
echo Error: Missing tag name. Use -t "tag_name"
exit /b 1
)
if "%remoteName%"=="" (
echo Error: Missing remote name. Use -r "remote"
exit /b 1
)
:: Commit, tag, and push
echo "%commitMessage%"
git add .
git commit -m "%commitMessage%"
git tag "%tagName%"
git push --tags
git push -uf %remoteName%
echo Done!