Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 524971e

Browse files
committed
fix sls invoke local not works.
1 parent 2756915 commit 524971e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

unzip_requirements.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
if os.path.exists(tempdir):
1414
shutil.rmtree(tempdir)
1515

16-
zip_requirements = os.path.join(
17-
os.environ.get('LAMBDA_TASK_ROOT', os.getcwd()), '.requirements.zip')
16+
default_lambda_task_root = os.environ.get('LAMBDA_TASK_ROOT', os.getcwd())
17+
lambda_task_root = os.getcwd() if os.environ.get('IS_LOCAL') == 'true' else default_lambda_task_root
18+
zip_requirements = os.path.join(lambda_task_root, '.requirements.zip')
1819

1920
zipfile.ZipFile(zip_requirements, 'r').extractall(tempdir)
2021
os.rename(tempdir, pkgdir) # Atomic

0 commit comments

Comments
 (0)