automation-lib 6.6.414 → 6.6.416
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commit.bat +24 -49
- package/dist/index.d.mts +27 -9
- package/dist/index.d.ts +27 -9
- package/dist/index.js +13 -0
- package/dist/index.mjs +12 -0
- package/package.json +2 -2
package/commit.bat
CHANGED
|
@@ -1,75 +1,50 @@
|
|
|
1
1
|
@echo off
|
|
2
|
-
setlocal enabledelayedexpansion
|
|
3
2
|
|
|
4
|
-
::
|
|
5
|
-
set /p commit_message="Enter commit message: "
|
|
6
|
-
|
|
7
|
-
:: 2. Commit code hien tai
|
|
8
|
-
echo [1/7] Adding and committing changes...
|
|
3
|
+
:: Add all changes to git
|
|
9
4
|
git add .
|
|
10
|
-
git commit -m "%commit_message%"
|
|
11
5
|
|
|
12
|
-
::
|
|
13
|
-
echo
|
|
14
|
-
|
|
6
|
+
:: Commit changes with a message
|
|
7
|
+
echo Committing changes...
|
|
8
|
+
set /p commit_message="Enter commit message: "
|
|
9
|
+
git commit -m "%commit_message%"
|
|
10
|
+
sleep 2
|
|
15
11
|
|
|
16
|
-
::
|
|
17
|
-
|
|
18
|
-
echo.
|
|
19
|
-
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
20
|
-
echo PHAT HIEN XUNG DOT (CONFLICT) tai cac file sau:
|
|
21
|
-
:: Liet ke cac file dang bi Unmerged (conflict)
|
|
22
|
-
git diff --name-only --diff-filter=U
|
|
23
|
-
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
24
|
-
echo.
|
|
25
|
-
|
|
26
|
-
set /p confirm="Ban co muon ghi de tat ca bang 'Incoming Changes' (theirs) khong? (y/n): "
|
|
27
|
-
|
|
28
|
-
if /i "!confirm!"=="y" (
|
|
29
|
-
echo Dang ghi de file bang code tu nhanh toan...
|
|
30
|
-
:: Lenh nay se lay phan noi dung cua 'theirs' cho cac file conflict
|
|
31
|
-
git checkout --theirs .
|
|
32
|
-
git add .
|
|
33
|
-
git commit -m "fix: auto resolve conflicts by taking theirs"
|
|
34
|
-
) else (
|
|
35
|
-
echo.
|
|
36
|
-
echo [DUNG LAI] Hay mo VS Code de sua tay cac file tren.
|
|
37
|
-
echo Sau khi sua xong, hay chay lai script hoac push thu cong.
|
|
38
|
-
pause
|
|
39
|
-
exit /b
|
|
40
|
-
)
|
|
41
|
-
)
|
|
12
|
+
:: Push changes to the 'main' branch of the 'cp' remote
|
|
13
|
+
git pull origin toan
|
|
42
14
|
|
|
43
|
-
::
|
|
44
|
-
echo [3/7] Updating version...
|
|
15
|
+
:: Read the current version from package.json
|
|
45
16
|
for /f "tokens=2 delims=:, " %%i in ('findstr "version" package.json') do set currentVersion=%%i
|
|
17
|
+
|
|
18
|
+
:: Remove quotes from the version string
|
|
46
19
|
set currentVersion=%currentVersion:"=%
|
|
47
|
-
set currentVersion=%currentVersion:,=%
|
|
48
20
|
|
|
21
|
+
:: Split version into its components
|
|
49
22
|
for /f "tokens=1,2,3 delims=." %%a in ("%currentVersion%") do (
|
|
50
23
|
set major=%%a
|
|
51
24
|
set minor=%%b
|
|
52
25
|
set patch=%%c
|
|
53
26
|
)
|
|
54
27
|
|
|
28
|
+
:: Increment the patch version
|
|
55
29
|
set /a patch+=1
|
|
30
|
+
|
|
31
|
+
:: Create the new version string
|
|
56
32
|
set newVersion=%major%.%minor%.%patch%
|
|
57
33
|
|
|
34
|
+
:: Update the version in package.json
|
|
58
35
|
powershell -Command "(Get-Content package.json) -replace '\"version\": \"%currentVersion%\"', '\"version\": \"%newVersion%\"' | Set-Content package.json"
|
|
36
|
+
|
|
37
|
+
:: Display the new version
|
|
59
38
|
echo New version: %newVersion%
|
|
60
39
|
|
|
61
|
-
::
|
|
62
|
-
echo [4/7] Running npm publish...
|
|
40
|
+
:: Run npm publish using call
|
|
63
41
|
call npm run pub
|
|
64
42
|
|
|
65
|
-
:: 6. Commit package.json
|
|
66
|
-
echo [5/7] Committing version bump...
|
|
67
43
|
git add .
|
|
68
|
-
|
|
44
|
+
sleep 1
|
|
45
|
+
git commit -m "%commit_message%"
|
|
46
|
+
sleep 2
|
|
47
|
+
|
|
48
|
+
git push origin toan
|
|
69
49
|
|
|
70
|
-
:: 7. PUSH LEN MAIN
|
|
71
|
-
echo [6/7] Pushing to hs main...
|
|
72
|
-
git push hs main
|
|
73
50
|
|
|
74
|
-
echo [7/7] Hoan thanh ruc ro!
|
|
75
|
-
pause
|