Repository navigation
Expand file tree
/
Copy pathsync_pyright.sh
More file actions
executable file
·57 lines (42 loc) · 1.7 KB
/
Copy pathsync_pyright.sh
File metadata and controls
executable file
·57 lines (42 loc) · 1.7 KB
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
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/bash
set -e
set -o pipefail
if ! git diff --quiet; then
echo "======================================="
echo " Please clean up your dirty repo"
echo "======================================="
exit 1
fi
echo "===== Syncing Pyright and Creating New Branch ====="
if ! git remote show | grep upstream -q; then
echo "Adding upstream"
git remote add upstream https://github.com/microsoft/pyright
fi
if ! git rev-parse --verify pyright-mirror >/dev/null 2>&1 ; then
echo "Adding pyright main branch to local dev env as pyright-mirror"
git fetch upstream main:pyright-mirror --no-tags
git branch --set-upstream-to=upstream/main pyright-mirror
fi
git checkout pyright-mirror
git pull --no-tags upstream main:pyright-mirror
LATEST_PYRIGHT_COMMIT=$(git rev-parse --verify HEAD)
git checkout scip
git pull
git checkout -b pyright-sync-$(date +%F)
if ! git merge pyright-mirror; then
echo "Checking out some files that are pretty much guaranteed to be messed up"
git checkout --ours README.md && \
git add README.md
git checkout --theirs package-lock.json && \
git add package-lock.json
git checkout --theirs packages/pyright-internal/package-lock.json && \
git add packages/pyright-internal/package-lock.json
git checkout --theirs packages/pyright/package-lock.json && \
git add packages/pyright/package-lock.json
git checkout --theirs packages/vscode-pyright/package-lock.json && \
git add packages/vscode-pyright/package-lock.json
fi
echo $LATEST_PYRIGHT_COMMIT > pyright-last-commit
echo "Make sure to handle any merge conflicts"
echo " and rebuild the project to make sure everything is working"
echo " before we merge"