Skip to content

Commit fe3cf2b

Browse files
committed
tools: remove git diff exit-code and lint the code
1 parent 2ca6954 commit fe3cf2b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tools/dep_updaters/update-zlib.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ DEPS_DIR="$BASE_DIR/deps"
1010
echo "Comparing latest upstream with current revision"
1111

1212
# Revert zconf.h changes before checking diff
13-
perl -i -pe 's|^//#include "chromeconf.h"|#include "chromeconf.h"|' $DEPS_DIR/zlib/zconf.h
14-
git stash
13+
perl -i -pe 's|^//#include "chromeconf.h"|#include "chromeconf.h"|' "$DEPS_DIR/zlib/zconf.h"
14+
git stash -- "$DEPS_DIR/zlib/zconf.h"
15+
1516
git fetch https://chromium.googlesource.com/chromium/src/third_party/zlib.git HEAD
1617

17-
DIFF_TREE=$(
18-
git diff stash@{0}:deps/zlib FETCH_HEAD -- zconf.h
19-
git diff --exit-code --diff-filter=d HEAD:deps/zlib FETCH_HEAD -- ':!zconf.h' || echo 1
20-
)
18+
DIFF_TREE=$(git diff --diff-filter=d 'stash@{0}:deps/zlib' FETCH_HEAD)
2119

2220
git stash drop
2321

@@ -73,7 +71,7 @@ mkdir "$DEPS_DIR/zlib/win32"
7371

7472
mv "$DEPS_DIR/zlib.def" "$DEPS_DIR/zlib/win32"
7573

76-
perl -i -pe 's|^#include "chromeconf.h"|//#include "chromeconf.h"|' $DEPS_DIR/zlib/zconf.h
74+
perl -i -pe 's|^#include "chromeconf.h"|//#include "chromeconf.h"|' "$DEPS_DIR/zlib/zconf.h"
7775

7876
echo "All done!"
7977
echo ""

0 commit comments

Comments
 (0)