fix: ensure build.sh find correct changed files #5

Merged
unkinben merged 1 commits from neoloc/fix_default_build into master 2025-01-12 18:00:36 +11:00

View File

@ -1,10 +1,13 @@
#!/bin/bash #!/bin/bash
# Check for changes in builds/ folder # Check for changes in images/ folder and the builds/ folder
builds_changes=$(git diff --name-only master | grep -E '^builds/') if [ "$(git branch --show-current)" = "master" ]; then
builds_changes=$(git diff --name-only HEAD^...master | grep -E '^builds/')
# Check for changes in images/ folder images_changes=$(git diff --name-only HEAD^...master | grep -E '^images/')
images_changes=$(git diff --name-only master | grep -E '^images/') else
builds_changes=$(git diff --name-only master | grep -E '^builds/')
images_changes=$(git diff --name-only master | grep -E '^images/')
fi
# Run `make all` if there are changes in builds/ # Run `make all` if there are changes in builds/
if [ -n "$builds_changes" ]; then if [ -n "$builds_changes" ]; then