Skip to content

Commit 0777961

Browse files
authored
fix: add documentation for the :zip command (#115)
1 parent 7c7c56c commit 0777961

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,10 @@ source_path = [
389389
]
390390
}, {
391391
path = "src/python3.8-app3",
392-
commands = ["npm install"],
392+
commands = [
393+
"npm install",
394+
":zip"
395+
],
393396
patterns = [
394397
"!.*/.*\\.txt", # Skip all txt files recursively
395398
"node_modules/.+", # Include all node_modules
@@ -424,6 +427,7 @@ Few notes:
424427
```
425428

426429
* `commands` - List of commands to run. If specified, this argument overrides `pip_requirements`.
430+
* `:zip [source] [destination]` is a special command which creates content of current working directory (first argument) and places it inside of path (second argument).
427431
* `pip_requirements` - Controls whether to execute `pip install`. Set to `false` to disable this feature, `true` to run `pip install` with `requirements.txt` found in `path`. Or set to another filename which you want to use instead.
428432
* `prefix_in_zip` - If specified, will be used as a prefix inside zip-archive. By default, everything installs into the root of zip-archive.
429433

examples/simple/main.tf

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,10 @@ module "lambda_function" {
255255
# },
256256
# {
257257
# path = "${path.module}/../fixtures/python3.8-app1"
258-
# commands = ["npm install"]
258+
# commands = [
259+
# "npm install",
260+
# ":zip"
261+
# ]
259262
# prefix_in_zip = "foo/bar",
260263
# patterns = [
261264
# "!.*/.*\\.txt", # Filter all txt files recursively
@@ -264,7 +267,10 @@ module "lambda_function" {
264267
# },
265268
# {
266269
# path = "${path.module}/../fixtures/python3.8-app1"
267-
# commands = ["npm install"]
270+
# commands = [
271+
# "npm install",
272+
# ":zip"
273+
# ]
268274
# prefix_in_zip = "foo/bar", # By default everything installs into the root of a zip package
269275
# patterns = <<END
270276
# !.*/.*\.txt # Filter all txt files recursively
@@ -281,7 +287,10 @@ module "lambda_function" {
281287
# },
282288
# {
283289
# path = "${path.module}/../fixtures/python3.8-app1"
284-
# commands = ["npm install"]
290+
# commands = [
291+
# "npm install",
292+
# ":zip"
293+
# ]
285294
# prefix_in_zip = "foo/bar",
286295
# patterns = [".*"] # default
287296
# }

0 commit comments

Comments
 (0)