Fixed lb_update generation

This commit is contained in:
Divarion-D
2025-10-12 17:41:45 +03:00
parent e7eb575ea0
commit a0d00c9cde

View File

@@ -111,13 +111,23 @@ lb_update_copy_files:
@mkdir -p $(DIST_DIR)
@mkdir -p $(TEMP_DIR)
@echo "[INFO] Copying modified or added files from 'src/'..."
@echo "[INFO] Copying modified or added files from 'src/' that are in LB_FILES..."
@for file in $$(git diff --name-status $(LAST_TAG)..HEAD | grep -E '^[AM]' | cut -f2 | grep '^src/'); do \
rel_path=$$(echo "$$file" | sed 's|^src/||'); \
if [ -f "$$file" ]; then \
# Check if the file belongs to one of the allowed directories LB_FILES \
allowed=0; \
for lb_item in $(LB_FILES); do \
if echo "$$rel_path" | grep -q "^$$lb_item/"; then \
allowed=1; \
break; \
fi; \
done; \
if [ "$$allowed" -eq 1 ] && [ -f "$$file" ]; then \
echo "[COPY] $$file -> $(TEMP_DIR)/$$rel_path"; \
mkdir -p "$(TEMP_DIR)/$$(dirname $$rel_path)"; \
cp "$$file" "$(TEMP_DIR)/$$rel_path"; \
else \
echo "[SKIP] $$file (not in LB_FILES)"; \
fi \
done