This commit is contained in:
2019-09-19 01:04:06 -04:00
parent 33fad76a96
commit c39ac392c0
2 changed files with 8 additions and 3 deletions
+3 -2
View File
@@ -307,7 +307,8 @@ class TaskScript(BaseAction):
# Grab the first source line, for shebang comparison.
try:
first_natural_line = sources[0].split("\n", 1)[0]
# Last script comes first.
first_natural_line = sources[-1].split("\n", 1)[0]
except IndexError:
# TODO: maybe not.
first_natural_line = "#!/usr/bin/env bash"
@@ -318,7 +319,7 @@ class TaskScript(BaseAction):
yield shebang
if insert_source and Bakefile._is_safe_to_inject(shebang=shebang):
init_source = f"source <(bake --source {insert_source})"
init_source = f". <(bake --source {insert_source})"
yield init_source
source_container.extend(sources)
+5 -1
View File
@@ -249,7 +249,11 @@ def entrypoint(
else:
task = bakefile.tasks[source]
source = task.gen_source(
sources=[task.source],
sources=[
task.bashfile.funcs_source,
task.bashfile.root_source,
task.source,
],
remove_comments=True,
insert_source="__init__",
include_shebang=True,