Commit 6c09a0c 1 parent accbd6e commit 6c09a0c Copy full SHA for 6c09a0c
File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ stableVersion=" <5.7.0"
4
+
5
+ remote_name=" origin"
6
+ if git ls-remote --exit-code --heads " $remote_name " " master" ; then
7
+ master_branch=" master"
8
+ fi
9
+ if git ls-remote --exit-code --heads " $remote_name " " main" ; then
10
+ master_branch=" main"
11
+ fi
12
+ if [ -n " ${master_branch} " ]; then
13
+ git checkout " ${master_branch} "
14
+ fi
15
+ git pull
16
+ git fetch -p
17
+ for branch_name in $( git branch -r | grep -v ' \->' | sed ' s/origin\///' | grep -v ' master' | grep -v ' main' | grep -v ' migration-to-kotlin' | grep -v ' 1.0.0-eol-continuous-release-branch-recovered' | grep -v ' migrate-to-kotlin' ) ; do
18
+ echo " Processing branch: $branch_name "
19
+ if [ -n " ${master_branch} " ]; then
20
+ git checkout " ${branch_name} "
21
+ git pull
22
+ git merge origin/" ${master_branch} " --no-edit
23
+ find . -name " package.json" -not -path " */node_modules/*" | while read -r file; do
24
+ echo " Processing $file "
25
+ sed -i.bak -E ' s/"typescript":\s*"<?~?([0-9]+\.)?([0-9]+\.)?[0-9]+"/"typescript": "' $stableVersion ' "/' " $file "
26
+ echo " Updated $file "
27
+ done
28
+ find . -name " package.json.bak" -not -path " */node_modules/*" -delete
29
+ git push
30
+ gh pr merge $( gh pr list --base " ${master_branch} " --head " ${branch_name} " --json number --jq ' .[0].number' | xargs echo) --auto --merge
31
+ git checkout " ${master_branch} "
32
+ fi
33
+ done
You can’t perform that action at this time.
0 commit comments