From c85f5f81035d98cdc2b51d4e00804e89c4cf6c53 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Wed, 21 Sep 2022 16:20:51 -0500 Subject: [PATCH] fix: make /bin/bash the default shell --- src/builtins.mk | 3 +++ src/config.mk | 1 + src/quit_make.py | 8 ++------ task.mk | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/builtins.mk b/src/builtins.mk index 145e056..6e92baf 100644 --- a/src/builtins.mk +++ b/src/builtins.mk @@ -31,3 +31,6 @@ _update-task.mk: $(call tprint,{a.b_cyan}Updating task.mk{a.end}) curl https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk export MAKEFILE_LIST +ifndef INHERIT_SHELL +SHELL := /bin/bash +endif diff --git a/src/config.mk b/src/config.mk index b2335a4..a0c1fa9 100644 --- a/src/config.mk +++ b/src/config.mk @@ -10,3 +10,4 @@ HELP_SEP ?= │ # python f-string literals EPILOG ?= USAGE ?={ansi.$(HEADER_STYLE)}usage{ansi.end}:\n make \n +INHERIT_SHELL ?= diff --git a/src/quit_make.py b/src/quit_make.py index 7ff6fa4..14cb066 100644 --- a/src/quit_make.py +++ b/src/quit_make.py @@ -2,15 +2,11 @@ #% block name %#quit_make#% endblock %# #% block script %# -import os, signal, sys +import os, signal def quit_make(): - old_stdout = sys.stdout - with open(os.devnull, "w") as f: - sys.stdout = f - os.kill(os.getppid(), signal.SIGQUIT) - sys.stdout = old_stdout + os.kill(os.getppid(), signal.SIGQUIT) #% endblock %# diff --git a/task.mk b/task.mk index 667c0db..9d60779 100644 --- a/task.mk +++ b/task.mk @@ -1,7 +1,7 @@ # }> [github.com/daylinmorgan/task.mk] <{ # # Copyright (c) 2022 Daylin Morgan # MIT License -# version: v22.9.19-4-g071f7fc-dev +# version: v22.9.19-5-g5f593e3-dev # # task.mk should be included at the bottom of your Makefile with `-include .task.mk` # See below for the standard configuration options that should be set prior to including this file. @@ -18,6 +18,7 @@ HELP_SEP ?= │ # python f-string literals EPILOG ?= USAGE ?={ansi.$(HEADER_STYLE)}usage{ansi.end}:\n make \n +INHERIT_SHELL ?= # ---- [builtin recipes] ---- # ifeq (help,$(firstword $(MAKECMDGOALS))) HELP_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) @@ -51,6 +52,9 @@ _update-task.mk: $(call tprint,{a.b_cyan}Updating task.mk{a.end}) curl https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk export MAKEFILE_LIST +ifndef INHERIT_SHELL +SHELL := /bin/bash +endif # ---- [python/bash script runner] ---- # define _newline @@ -322,11 +326,7 @@ else: quit_make() endef define quit_make_py -import os, signal, sys +import os, signal def quit_make(): - old_stdout = sys.stdout - with open(os.devnull, "w") as f: - sys.stdout = f - os.kill(os.getppid(), signal.SIGQUIT) - sys.stdout = old_stdout + os.kill(os.getppid(), signal.SIGQUIT) endef