From 7032f5cd3ed9582a3cdbe5eeb12af94f76632c99 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 19 Sep 2019 00:49:54 -0400 Subject: [PATCH] ermgahd --- bake/bakefile.py | 11 +---------- bake/cli.py | 10 +++++----- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/bake/bakefile.py b/bake/bakefile.py index 3331ccb..8c588d0 100644 --- a/bake/bakefile.py +++ b/bake/bakefile.py @@ -303,10 +303,6 @@ class TaskScript(BaseAction): if sources is None: sources = [] - stdlib_path = os.path.join(os.path.dirname(__file__), "scripts", "stdlib.sh") - with open(stdlib_path, "r") as f: - stdlib = f.read() - source_container = [] # Grab the first source line, for shebang comparison. @@ -335,11 +331,7 @@ class TaskScript(BaseAction): init_source = f"source <(bake --source {insert_source})" yield init_source - source_container += [ - stdlib, - self.bashfile.funcs_source, - self.bashfile.root_source, - ] + source_container += [self.bashfile.funcs_source, self.bashfile.root_source] main_source = "\n".join(source_container) @@ -486,7 +478,6 @@ class Bakefile: yield (i, line.rstrip()) else: yield (i, None) - # yield (i, None) @property def home(self): diff --git a/bake/cli.py b/bake/cli.py index 40939d7..e15f1ef 100644 --- a/bake/cli.py +++ b/bake/cli.py @@ -240,8 +240,11 @@ def entrypoint( if source == "__init__": source = random.choice(list(bakefile.tasks.keys())) - source = bakefile.tasks[source].gen_source( - remove_comments=True, include_shebang=True + task = bakefile.tasks[source] + source = task.gen_source( + remove_comments=True, + include_shebang=True, + sources=[task.bashfile.funcs_source, task.bashfile.root_source], ) else: task = bakefile.tasks[source] @@ -252,10 +255,7 @@ def entrypoint( include_shebang=True, ) - # Giving up — it's just easier to do it here. - # click.echo("#!/usr/bin/env bash") for source_line in source: - # print(source_line) click.echo(source_line) sys.exit(0)