Skip to content

Commit

Permalink
feat: allow to don't specify path in source_path and use explicit…
Browse files Browse the repository at this point in the history
… :zip commands
  • Loading branch information
ahlinc committed Nov 18, 2024
1 parent aa2cb10 commit a4fd2e1
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions package.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,11 @@ def plan(self, source_path, query):
source_paths = []
build_plan = []

step = lambda *x: build_plan.append(x)
hash = source_paths.append
def step(*x):
build_plan.append(x)

def hash(path):
source_paths.append(path)

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

0 comments on commit a4fd2e1

Please sign in to comment.