Skip to content

Commit 380c122

Browse files
authored
Merge pull request MicroShed#227 from scottkurz/fix-precommit-issue-with-format-list-truncated
Fix issue where files to format list was getting truncated due to cas…
2 parents 5c10a50 + 0eeab39 commit 380c122

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pre-commit.template

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ statusFile=status.$RANDOM
3737
fileCommand="git status --porcelain 2>&1 > $statusFile"
3838
$(eval $fileCommand)
3939

40-
newlist=Y
40+
newList=Y
4141
while read -r
4242
do
4343
line="$REPLY"
@@ -64,11 +64,11 @@ do
6464
# We had some inconsistencies with Git versions and sed versions, so hopefully this covers all cases.
6565
newFileCmd="echo \"$line\" | sed 's/.* //'"
6666
newFile=$(eval "$newFileCmd")
67-
if [ $newlist == "Y" ] ; then
67+
if [ $newList == "Y" ] ; then
6868
# formatFiles are input to the eclipse formatter
6969
formatFiles=$PROJECT_LOCATION/$newFile
7070
checkIfFormatted=$newFile
71-
newlist=N
71+
newList=N
7272
else
7373
formatFiles="$formatFiles $PROJECT_LOCATION/$newFile"
7474
checkIfFormatted="$checkIfFormatted $newFile"
@@ -78,7 +78,7 @@ do
7878
# Note the sed output is an absolute path including project location
7979
newFileCmd="echo $line | cut -c 3- | sed -e 's|^|$PROJECT_LOCATION/|'"
8080
newFile=$(eval "$newFileCmd")
81-
if [ $newlist == "Y" ] ; then
81+
if [ $newList == "Y" ] ; then
8282
formatFiles="$newFile"
8383
checkIfFormatted=$newFile
8484
newList=N

0 commit comments

Comments
 (0)