Skip to content

Commit

Permalink
fix transform check-exists target to not print errors when dir does n…
Browse files Browse the repository at this point in the history
…ot exist

Signed-off-by: David Wood <[email protected]>
  • Loading branch information
daw3rd committed Jan 17, 2025
1 parent 0fec98b commit 8b537b1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions transforms/.make.transforms
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,21 @@ test-locals:: .transforms.test-locals

.PHONY: .transforms-check-exists
.transforms-check-exists:
@exists=$$(find $(CHECK_DIR) -name $(CHECK_FILE_NAME)); \
@if [ ! -d "$(CHECK_DIR)" ]; then \
echo $$REQ create $(CHECK_FILE_NAME) in directory $(CHECK_DIR); \
exit 0; \
fi; \
exists=$$(find $(CHECK_DIR) -name $(CHECK_FILE_NAME)); \
if [ -z "$$exists" ]; then \
echo $$REQ create $(CHECK_FILE_NAME) in directory $(CHECK_DIR); \
fi

.PHONY: .transforms-check-not-exists
.transforms-check-not-exists:
@exists=$$(find $(CHECK_DIR) -name $(CHECK_FILE_NAME)); \
@if [ ! -d "$(CHECK_DIR)" ]; then \
exit 0; \
fi; \
exists=$$(find $(CHECK_DIR) -name $(CHECK_FILE_NAME)); \
if [ ! -z "$$exists" ]; then \
echo $REQ remove file $(CHECK_FILE_NAME) from directory $(CHECK_DIR); \
fi
Expand Down

0 comments on commit 8b537b1

Please sign in to comment.