-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
Expand file tree
/
Copy pathupdate-inspector-protocol.sh
More file actions
executable file
·45 lines (32 loc) · 1.31 KB
/
update-inspector-protocol.sh
File metadata and controls
executable file
·45 lines (32 loc) · 1.31 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
#!/bin/sh
set -e
# Shell script to update inspector_protocol in the source tree to the version same with V8's.
BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd)
DEPS_DIR="$BASE_DIR/deps"
# shellcheck disable=SC1091
. "$BASE_DIR/tools/dep_updaters/utils.sh"
echo "Making temporary workspace..."
WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp')
cd "$WORKSPACE"
git clone https://chromium.googlesource.com/deps/inspector_protocol.git
INSPECTOR_PROTOCOL_DIR="$WORKSPACE/inspector_protocol"
echo "Comparing latest upstream with current revision"
set +e
python "$BASE_DIR/tools/inspector_protocol/roll.py" \
--ip_src_upstream "$INSPECTOR_PROTOCOL_DIR" \
--node_src_downstream "$BASE_DIR"
STATUS="$?"
set -e
if [ "$STATUS" = "0" ]; then
echo "Skipped because inspector_protocol is on the latest version."
exit 0
fi
python "$BASE_DIR/tools/inspector_protocol/roll.py" \
--ip_src_upstream "$INSPECTOR_PROTOCOL_DIR" \
--node_src_downstream "$BASE_DIR" \
--force
NEW_VERSION=$(grep "Revision:" "$DEPS_DIR/inspector_protocol/README.node" | sed -n 's/^Revision: \([[:xdigit:]]\{36\}\).*$/\1/p')
# Update the version number on maintaining-dependencies.md
# and print the new version as the last line of the script as we need
# to add it to $GITHUB_ENV variable
finalize_version_update "inspector_protocol" "$NEW_VERSION"