mirror of
https://github.com/kennethreitz/bake.git
synced 2026-06-05 23:00:17 +00:00
v0.4.0; interactive mode
This commit is contained in:
+8
-2
@@ -252,7 +252,9 @@ class TaskScript(BaseAction):
|
||||
|
||||
return tf
|
||||
|
||||
def execute(self, *, blocking=False, debug=False, silent=False, **kwargs):
|
||||
def execute(
|
||||
self, *, blocking=False, debug=False, interactive=False, silent=False, **kwargs
|
||||
):
|
||||
|
||||
init_tf = self.prepare_init()
|
||||
if self.bashfile._is_shebang_line(self.source_lines[0]):
|
||||
@@ -268,7 +270,11 @@ class TaskScript(BaseAction):
|
||||
|
||||
args = " ".join([shlex_quote(a) for a in self.bashfile.args])
|
||||
|
||||
script = f"source {shlex_quote(init_tf)}; {shlex_quote(script_tf)} {args} 2>&1 | bake:indent"
|
||||
if interactive:
|
||||
script = f"source {shlex_quote(init_tf)}; {shlex_quote(script_tf)} {args}"
|
||||
else:
|
||||
script = f"source {shlex_quote(init_tf)}; {shlex_quote(script_tf)} {args} 2>&1 | bake:indent"
|
||||
|
||||
cmd = f"bash -c {shlex_quote(script)}"
|
||||
|
||||
if debug:
|
||||
|
||||
+11
-1
@@ -143,6 +143,13 @@ def echo_json(obj):
|
||||
type=click.BOOL,
|
||||
help="Continue, if a task fails.",
|
||||
)
|
||||
@click.option(
|
||||
"--interactive",
|
||||
"-i",
|
||||
is_flag=True,
|
||||
type=click.BOOL,
|
||||
help="Run in interactive mode.",
|
||||
)
|
||||
@click.option(
|
||||
"--insecure",
|
||||
is_flag=True,
|
||||
@@ -188,6 +195,7 @@ def entrypoint(
|
||||
_json,
|
||||
skip_done,
|
||||
no_deps,
|
||||
interactive,
|
||||
yes,
|
||||
help,
|
||||
):
|
||||
@@ -344,7 +352,9 @@ def entrypoint(
|
||||
+ click.style(":", fg="white"),
|
||||
err=True,
|
||||
)
|
||||
return_code = task.execute(yes=yes, debug=debug, silent=silent)
|
||||
return_code = task.execute(
|
||||
yes=yes, debug=debug, silent=silent, interactive=interactive
|
||||
)
|
||||
|
||||
if not _continue:
|
||||
if (not return_code == 0) and (not isinstance(return_code, tuple)):
|
||||
|
||||
@@ -18,7 +18,7 @@ URL = "https://github.com/kennethreitz/bake"
|
||||
EMAIL = "me@kennethreitz.org"
|
||||
AUTHOR = "Kenneth Reitz"
|
||||
REQUIRES_PYTHON = ">=3.6.0"
|
||||
VERSION = "0.3.1"
|
||||
VERSION = "0.4.0"
|
||||
|
||||
# What packages are required for this module to be executed?
|
||||
REQUIRED = ["click", "delegator.py", "pygments", "networkx"]
|
||||
|
||||
Reference in New Issue
Block a user