Skip to content

Commit

Permalink
CCM-6405 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenvaines-bjss committed Sep 9, 2024
1 parent 126ac2c commit 4fe648f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scripts/githooks/sync-template-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ if [ ! -f "${IGNORE_FILE}" ]; then
fi

# Read the .template-ignore file into an array
# readarray -t IGNORED_PATHS < "${IGNORE_FILE}"
while IFS= read -r line || [ -n "$line" ]; do
IGNORED_PATHS+=("$line")
done < "$IGNORE_FILE"
Expand Down Expand Up @@ -68,7 +67,7 @@ while IFS= read -r -d '' file; do

# Check if the file is ignored
if is_ignored "$relative_path"; then
# echo "Ignoring $relative_path"
echo "Ignoring $relative_path"
continue
fi

Expand All @@ -79,15 +78,15 @@ while IFS= read -r -d '' file; do
if [ ! -f "$target_path" ] && [ "$changes_only" == false ]; then
echo "Copying $relative_path to the repository"
FILES_ADDED+=("${relative_path}")
# cp "$file" "$target_path"
cp "$file" "$target_path"

else
# If the file exists, check if it's different
if [ "$new_only" == false ]; then
if ! diff -q "$file" "$target_path" > /dev/null 2>&1; then
# echo "Merging changes from $relative_path"
echo "Merging changes from $relative_path"
FILES_WITH_CHANGES+=("${relative_path}")
# cp "$file" "$target_path"
cp "$file" "$target_path"
fi
fi
fi
Expand Down

0 comments on commit 4fe648f

Please sign in to comment.