-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
#1. 변경된 파일들 이름만 추출하여 저장 | ||
stagedFiles=$(git diff --staged --name-only) | ||
#2. SpotlessApply 실행 | ||
echo "Running spotlessApply. Formatting code..." | ||
./gradlew spotlessApply | ||
#3. 변경사항이 발생한 파일들 다시 git add | ||
for file in $stagedFiles; do | ||
if test -f "$file"; then | ||
git add "$file" | ||
fi | ||
done |