Commit 379ad0c 1 parent 6c09a0c commit 379ad0c Copy full SHA for 379ad0c
File tree 2 files changed +45
-0
lines changed
2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ stableVersion=" <5.7.0"
3
+
4
+ remote_name=" origin"
5
+ cd ..
6
+ for item in * ; do
7
+ if [[ -d " $item " ]]; then
8
+ cd " ${item} " || exit
9
+ echo " ---*** Setting stable typescript $stableVersion PRs in project $item ***---"
10
+ if git ls-remote --exit-code --heads " $remote_name " " master" ; then
11
+ master_branch=" master"
12
+ fi
13
+ if git ls-remote --exit-code --heads " $remote_name " " main" ; then
14
+ master_branch=" main"
15
+ fi
16
+ if [ -n " ${master_branch} " ]; then
17
+ git checkout " ${master_branch} "
18
+ fi
19
+ git pull
20
+ git fetch -p
21
+ 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
22
+ echo " Processing branch: $branch_name "
23
+ if [ -n " ${master_branch} " ]; then
24
+ git checkout " ${branch_name} "
25
+ git pull
26
+ git merge origin/" ${master_branch} " --no-edit
27
+ find . -name " package.json" -not -path " */node_modules/*" | while read -r file; do
28
+ echo " Processing $file "
29
+ sed -i.bak -E ' s/"typescript":\s*"<?~?([0-9]+\.)?([0-9]+\.)?[0-9]+"/"typescript": "' $stableVersion ' "/' " $file "
30
+ echo " Updated $file "
31
+ done
32
+ find . -name " package.json.bak" -not -path " */node_modules/*" -delete
33
+ git add .
34
+ git commit -am " Typescript Update to $stableVersion "
35
+ git push
36
+ gh pr merge $( gh pr list --base " ${master_branch} " --head " ${branch_name} " --json number --jq ' .[0].number' | xargs echo) --auto --merge
37
+ git checkout " ${master_branch} "
38
+ fi
39
+ done
40
+ cd ..
41
+ fi
42
+ done
43
+ cd project-signer || exit
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ for branch_name in $(git branch -r | grep -v '\->' | sed 's/origin\///' | grep -
26
26
echo " Updated $file "
27
27
done
28
28
find . -name " package.json.bak" -not -path " */node_modules/*" -delete
29
+ git add .
30
+ git commit -am " Typescript Update to $stableVersion "
29
31
git push
30
32
gh pr merge $( gh pr list --base " ${master_branch} " --head " ${branch_name} " --json number --jq ' .[0].number' | xargs echo) --auto --merge
31
33
git checkout " ${master_branch} "
You can’t perform that action at this time.
0 commit comments