-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup_codebase.ps1
More file actions
31 lines (26 loc) · 780 Bytes
/
setup_codebase.ps1
File metadata and controls
31 lines (26 loc) · 780 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
#!/usr/bin/env pwsh
param($branch, $template_url = "https://github.com/KennethTrecy/web_template")
git remote add template $template_url
git fetch template $branch
git checkout template/$branch
git checkout -b template--$branch
git checkout -b merged_template
git merge master --allow-unrelated-histories
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 {
git branch -d template--$branch merged_template
git remote remove template
exit 1
}
}
git checkout master
Remove-Item setup_codebase.ps1
git add setup_codebase.ps1
git commit -m "chore: remove setup script"
Write-Output "Removed setup script."
& ./merge_from_template $branch