Skip to content

Commit 76ee21c

Browse files
authored
Merge pull request nficano#18 from cyriac/master
lambda init accepts optional folder name
2 parents bc3cf2b + 1b0ee0e commit 76ee21c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/lambda

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ def cli():
1616

1717

1818
@click.command(help="Create a new function for Lambda.")
19-
def init():
20-
aws_lambda.init(CURRENT_DIR)
19+
@click.argument('folder', nargs=-1, type=click.Path(file_okay=False, writable=True))
20+
def init(folder):
21+
path = CURRENT_DIR
22+
if len(folder) > 0:
23+
path = "{}/{}".format(CURRENT_DIR, folder[0])
24+
if not os.path.exists(path):
25+
os.makedirs(path)
26+
aws_lambda.init(path)
2127

2228

2329
@click.command(help="Bundles package for deployment.")

0 commit comments

Comments
 (0)