Skip to content

Commit

Permalink
Upgrade google-java-format from 1.6 to 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
wangkuiyi committed Jun 15, 2019
1 parent 9d0e0fe commit 4c8b492
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions format-code.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env sh
mkdir -p .cache
cd .cache
if [ ! -f google-java-format-1.6-all-deps.jar ]
if [ ! -f google-java-format-1.7-all-deps.jar ]
then
curl -LJO "https://github.com/google/google-java-format/releases/download/google-java-format-1.6/google-java-format-1.6-all-deps.jar"
chmod 755 google-java-format-1.6-all-deps.jar
curl -LJO "https://github.com/google/google-java-format/releases/download/google-java-format-1.6/google-java-format-1.7-all-deps.jar"
chmod 755 google-java-format-1.7-all-deps.jar
fi
cd ..

changed_java_files=$(git diff --cached --name-only --diff-filter=ACMR | grep ".*java$" )
echo $changed_java_files
java -jar .cache/google-java-format-1.6-all-deps.jar --replace $changed_java_files
java -jar .cache/google-java-format-1.7-all-deps.jar --replace $changed_java_files

0 comments on commit 4c8b492

Please sign in to comment.