Only first lambda update statement is running in my batch file

流过昼夜 提交于 2019-12-11 22:34:42

问题


Environment:
Windows 10
Command prompt

Why is only the first lambda update running in my batch file? Is this an asynchronous issue?

script.bat

...
aws lambda update-function-code --function-name "fx1" --zip-file fileb://zip1.zip
aws lambda update-function-code --function-name "fx2" --zip-file fileb://zip2.zip

回答1:


Assuming, aws is a batchfile:

When you execute another batchfile (B) from a batchfile (A), you transfer control from (A) to (B) and if (B) ends, there is no "return" to (A).

When you call the batchfile (B), (A) is paused until (B) finishes; Control is given back to (A) and (A) proceeds with the next line.

So you shouldn't execute aws:

aws lambda update-function-code --function-name "fx1" --zip-file fileb://zip1.zip

but call it:

call aws lambda update-function-code --function-name "fx1" --zip-file fileb://zip1.zip


来源:https://stackoverflow.com/questions/51435269/only-first-lambda-update-statement-is-running-in-my-batch-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!