diff --git a/bake/bakefile.py b/bake/bakefile.py index 57000e5..adc5689 100644 --- a/bake/bakefile.py +++ b/bake/bakefile.py @@ -26,11 +26,10 @@ class Bakefile: raise NoBakefileFound() # Set environment variables for 'bake's that run underneath of us. + os.environ["BAKE_SKIP_DONE"] = "1" + os.environ["BAKE_SILENT"] = "1" os.environ["PYTHONUNBUFFERED"] = "1" os.environ["BAKEFILE_PATH"] = self.path - os.environ["BAKE_SKIP_DONE"] = "1" - - os.environ["BAKE_SILENT"] = "1" self.chunks self._tasks = None @@ -229,20 +228,21 @@ class Bakefile: """Functions (_task_name), inserted into the Bash runtime.""" source = [] - for task in self.tasks: - task = self[task] - f_name = task.name.replace("/", "_") - f_name = f_name.replace("-", "_") - f_name = f"task_{f_name}" + # TODO: Recommend bake taskname instead. + # for task in self.tasks: + # task = self[task] + # f_name = task.name.replace("/", "_") + # f_name = f_name.replace("-", "_") + # f_name = f"task_{f_name}" - source.append( - # Replace / namespacing with _ namespacing, for functions. - f"{f_name}()" - + " { \n" - + f" bake --silent {task.name} $@;\n" - + "}\n" - + f"declare -x {f_name};" - ) + # source.append( + # # Replace / namespacing with _ namespacing, for functions. + # f"{f_name}()" + # + " { \n" + # + f" bake --silent {task.name} $@;\n" + # + "}\n" + # + f"declare -x {f_name};" + # ) return "\n".join(source) diff --git a/bake/cli.py b/bake/cli.py index 0d2f9bd..d7c861a 100644 --- a/bake/cli.py +++ b/bake/cli.py @@ -24,6 +24,7 @@ SAFE_ENVIRONS = [ "BAKEFILE_PATH", "PYTHONUNBUFFERED", "PYTHONDONTWRITEBYTECODE", + "BAKE_SILENT", ] @@ -142,20 +143,20 @@ def echo_json(obj): "--continue", "_continue", is_flag=True, - type=click.BOOL, + # type=click.BOOL, help="Continue, if a task fails.", ) @click.option( "--interactive", "-i", is_flag=True, - type=click.BOOL, + # type=click.BOOL, help="Run in interactive mode.", ) @click.option( "--insecure", is_flag=True, - type=click.BOOL, + # type=click.BOOL, help="Inherit parent shell's environment variables.", ) @click.argument("arguments", nargs=-1, type=click.STRING) @@ -163,7 +164,7 @@ def echo_json(obj): "--silent", "-s", is_flag=True, - type=click.BOOL, + # type=click.BOOL, help="Reduce output.", envvar="BAKE_SILENT", ) @@ -182,7 +183,7 @@ def echo_json(obj): "-j", "_json", is_flag=True, - type=click.BOOL, + # type=click.BOOL, help="Output in JSON format (stdout).", ) def entrypoint(