Open kirb opened 9 years ago
Tricky to solve, maybe even impossible, because all the solutions I've seen execute the check in a subshell ($(shell …)), and, well, that's a subshell, its output isn't going to be a tty.
$(shell …)
Tried:
_THEOS_IS_INTERACTIVE_SHELL = $(shell [ -t 1 ] && echo 1) # always false
_THEOS_IS_INTERACTIVE_SHELL = $(shell [ -t 0 ] && echo 1) # works, but only if piping something on stdin (very unlikely)
all:: @-[ -t 1 ] _THEOS_IS_INTERACTIVE_SHELL = $? # separate command from the one above, so $? is 0
INTERACTIVE := $(shell [ -t 0 ] && echo 1) ifdef INTERACTIVE _THEOS_IS_INTERACTIVE_SHELL = 1 else _THEOS_IS_INTERACTIVE_SHELL = 0 endif
See also (didn't work, at least on OS X with GNU make)
Tricky to solve, maybe even impossible, because all the solutions I've seen execute the check in a subshell (
$(shell …)
), and, well, that's a subshell, its output isn't going to be a tty.Tried:
See also (didn't work, at least on OS X with GNU make)