mirror of
https://github.com/kennethreitz/bake.git
synced 2026-06-05 23:00:17 +00:00
fixes
This commit is contained in:
+3
-2
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user