generated from KennethTrecy/web_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
merge_from_template.ps1
47 lines (38 loc) · 905 Bytes
/
merge_from_template.ps1
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
#!/usr/bin/env pwsh
param($branch)
git checkout template--$branch
git pull template $branch
git checkout merged_template
git merge template--$branch
if ($LastExitCode -ne 0) {
& git status
$answer = Read-Host -prompt "Have you fixed the conflicts? Enter 'y' to continue"
if ($answer -eq "y") {
& git add .
& git commit
} else {
exit 1
}
}
git merge dev
if ($LastExitCode -ne 0) {
& git status
$answer = Read-Host -prompt "Have you fixed the conflicts (currently in merged template)? Enter 'y' to continue"
if ($answer -eq "y") {
& git add .
& git commit
} else {
exit 1
}
}
git checkout dev
git checkout merged_template -- .
if ($LastExitCode -ne 0) {
& git status
$answer = Read-Host -prompt "Have you fixed the conflicts (currently in dev)? Enter 'y' to continue"
if ($answer -ne "y") {
exit 1
}
}
& git add .
& git commit -m "chore: update the files from template"