Skip to content

Commit

Permalink
[makefile] Update makefile to choose sed via command -v
Browse files Browse the repository at this point in the history
  • Loading branch information
vladikkuzn committed Mar 28, 2024
1 parent 56687a9 commit 5497c27
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Makefile
Expand Up @@ -84,15 +84,12 @@ SHELL = /usr/bin/env bash -o pipefail

# Setting SED allows macos users to install GNU sed and use the latter
# instead of the default BSD sed.
SED := /usr/bin/sed
# If the OS is Darwin (MacOS)
ifeq ($(shell uname), Darwin)
# Check if gsed is available
ifeq ($(shell command -v gsed 2>/dev/null),)
$(error "gsed could not be found, please install it.")
endif
# Set SED to gsed if available
SED := $(shell which gsed)
SED ?= $(shell command -v sed)
ifeq ($(shell command -v gsed 2>/dev/null),)
SED ?= $(shell command -v sed)
endif
ifeq ($(shell ${SED} --version 2>&1 | grep -q GNU; echo $$?),1)
$(error !!! GNU sed is required. If on OS X, use 'brew install gnu-sed'.)
endif

version_pkg = sigs.k8s.io/kueue/pkg/version
Expand Down

0 comments on commit 5497c27

Please sign in to comment.