Skip to content

Commit d143f0d

Browse files
authored
Merge pull request #55 from 10up/feat/auto-ignore-vendor-directory
Revert changes in vendor directory to fix SVN error
2 parents d441251 + 81155cb commit d143f0d

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

deploy.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ svn update --set-depth infinity trunk
5353
echo "➤ Copying files..."
5454
if [ "$IGNORE_OTHER_FILES" = true ]; then
5555
# Copy readme.txt to /trunk
56-
cp "$GITHUB_WORKSPACE/$README_NAME" trunk/$README_NAME
56+
cp "$GITHUB_WORKSPACE/$README_NAME" "trunk/$README_NAME"
5757

5858
# Use $TMP_DIR as the source of truth
5959
TMP_DIR=$GITHUB_WORKSPACE
@@ -127,6 +127,22 @@ fi
127127

128128
echo "➤ Preparing files..."
129129

130+
# Maybe revert composer changes in the vendor directory.
131+
# This is needed because composer dynamically generates files using hashing.
132+
# In reality, the files are not changed, but SVN thinks they are and processing will be stopped.
133+
134+
# Check if vendor/composer has changes
135+
if [[ -n $(svn stat trunk/vendor/composer) ]]; then
136+
echo "ℹ︎ Reverting changes in vendor/composer directory"
137+
svn revert --depth=infinity trunk/vendor/composer
138+
fi
139+
140+
# Check if vendor/autoload.php has changes
141+
if [[ -n $(svn stat trunk/vendor/autoload.php) ]]; then
142+
echo "ℹ︎ Reverting changes to vendor/autoload.php"
143+
svn revert trunk/vendor/autoload.php
144+
fi
145+
130146
svn status
131147

132148
if [[ -z $(svn stat) ]]; then
@@ -168,7 +184,7 @@ svn add . --force > /dev/null
168184
# Also suppress stdout here
169185
svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm %@ > /dev/null
170186

171-
#Resolves => SVN commit failed: Directory out of date
187+
# Resolves => SVN commit failed: Directory out of date
172188
svn update
173189

174190
# Now show full SVN status

0 commit comments

Comments
 (0)