Skip to content

Commit a4fd2e1

Browse files
committed
feat: allow to don't specify path in source_path and use explicit :zip commands
1 parent aa2cb10 commit a4fd2e1

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

package.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,11 @@ def plan(self, source_path, query):
676676
source_paths = []
677677
build_plan = []
678678

679-
step = lambda *x: build_plan.append(x)
680-
hash = source_paths.append
679+
def step(*x):
680+
build_plan.append(x)
681+
682+
def hash(path):
683+
source_paths.append(path)
681684

682685
def pip_requirements_step(path, prefix=None, required=False, tmp_dir=None):
683686
command = runtime
@@ -753,13 +756,6 @@ def commands_step(path, commands):
753756
if c.startswith(":zip"):
754757
if path:
755758
hash(path)
756-
else:
757-
# If path doesn't defined for a block with
758-
# commands it will be set to Terraform's
759-
# current working directory
760-
# NB: cwd may vary when using Terraform 0.14+ like:
761-
# `terraform -chdir=...`
762-
path = query.paths.cwd
763759
if batch:
764760
step("sh", path, "\n".join(batch))
765761
batch.clear()

0 commit comments

Comments
 (0)