cmg-ws2024525-demo/changed-directories.sh

9 lines
284 B
Bash
Raw Normal View History

2024-11-22 17:47:21 +01:00
#!/bin/bash
# Find changes between the latest commit and main
CHANGED_FILES=$(git diff --name-only origin/main..HEAD)
# Extract directories under 'services' that were changed
CHANGED_DIRS=$(echo "$CHANGED_FILES" | grep '^services/' | cut -d'/' -f2 | sort | uniq)
echo $CHANGED_DIRS