Skip to content

Commit 6ef2447

Browse files
authored
chore: fix Makefile goal gnu-sed to handle brew, port, and GNU sed on macOS gracefully (#877)
Signed-off-by: Jens Troeger <[email protected]>
1 parent 569f3f7 commit 6ef2447

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,16 @@ souffle:
175175
.PHONY: gnu-sed
176176
gnu-sed:
177177
if [ "$(OS_DISTRO)" == "Darwin" ]; then \
178-
brew install gnu-sed; \
179-
fi
178+
if ! command -v gsed; then \
179+
if command -v brew; then \
180+
brew install gnu-sed; \
181+
elif command -v port; then \
182+
sudo port install gsed; \
183+
else \
184+
echo "Unable to install GNU sed on macOS. Please install it manually." && exit 1; \
185+
fi; \
186+
fi; \
187+
fi;
180188

181189
# Install or upgrade an existing virtual environment based on the
182190
# package dependencies declared in pyproject.toml.

0 commit comments

Comments
 (0)