fix: make /bin/bash the default shell

This commit is contained in:
Daylin Morgan 2022-09-21 16:20:51 -05:00
parent 5f593e35c8
commit c85f5f8103
4 changed files with 13 additions and 13 deletions

View file

@ -31,3 +31,6 @@ _update-task.mk:
$(call tprint,{a.b_cyan}Updating task.mk{a.end}) $(call tprint,{a.b_cyan}Updating task.mk{a.end})
curl https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk curl https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk
export MAKEFILE_LIST export MAKEFILE_LIST
ifndef INHERIT_SHELL
SHELL := /bin/bash
endif

View file

@ -10,3 +10,4 @@ HELP_SEP ?= │
# python f-string literals # python f-string literals
EPILOG ?= EPILOG ?=
USAGE ?={ansi.$(HEADER_STYLE)}usage{ansi.end}:\n make <recipe>\n USAGE ?={ansi.$(HEADER_STYLE)}usage{ansi.end}:\n make <recipe>\n
INHERIT_SHELL ?=

View file

@ -2,15 +2,11 @@
#% block name %#quit_make#% endblock %# #% block name %#quit_make#% endblock %#
#% block script %# #% block script %#
import os, signal, sys import os, signal
def quit_make(): def quit_make():
old_stdout = sys.stdout os.kill(os.getppid(), signal.SIGQUIT)
with open(os.devnull, "w") as f:
sys.stdout = f
os.kill(os.getppid(), signal.SIGQUIT)
sys.stdout = old_stdout
#% endblock %# #% endblock %#

14
task.mk
View file

@ -1,7 +1,7 @@
# }> [github.com/daylinmorgan/task.mk] <{ # # }> [github.com/daylinmorgan/task.mk] <{ #
# Copyright (c) 2022 Daylin Morgan # Copyright (c) 2022 Daylin Morgan
# MIT License # 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` # 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. # 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 # python f-string literals
EPILOG ?= EPILOG ?=
USAGE ?={ansi.$(HEADER_STYLE)}usage{ansi.end}:\n make <recipe>\n USAGE ?={ansi.$(HEADER_STYLE)}usage{ansi.end}:\n make <recipe>\n
INHERIT_SHELL ?=
# ---- [builtin recipes] ---- # # ---- [builtin recipes] ---- #
ifeq (help,$(firstword $(MAKECMDGOALS))) ifeq (help,$(firstword $(MAKECMDGOALS)))
HELP_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(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}) $(call tprint,{a.b_cyan}Updating task.mk{a.end})
curl https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk curl https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk
export MAKEFILE_LIST export MAKEFILE_LIST
ifndef INHERIT_SHELL
SHELL := /bin/bash
endif
# ---- [python/bash script runner] ---- # # ---- [python/bash script runner] ---- #
define _newline define _newline
@ -322,11 +326,7 @@ else:
quit_make() quit_make()
endef endef
define quit_make_py define quit_make_py
import os, signal, sys import os, signal
def quit_make(): def quit_make():
old_stdout = sys.stdout os.kill(os.getppid(), signal.SIGQUIT)
with open(os.devnull, "w") as f:
sys.stdout = f
os.kill(os.getppid(), signal.SIGQUIT)
sys.stdout = old_stdout
endef endef