arm-learning-paths icon indicating copy to clipboard operation
arm-learning-paths copied to clipboard

De-duplicate container setup by adding a function to "docker exec"

Open DavidSpickett opened this issue 2 years ago • 0 comments

This function just does the 3 lines that were done before, make a cmd, log it, run it. We just don't have to write it out each time, and can't forget one of the lines.

By declaring it each time around the for loop, i is recaptured each time and we don't have to pass it to the function every time.

Simplified example:

>>> for i in range(3):
...     def foo():
...             return i
...     print(foo())
...
0
1
2

Before submitting a pull request for a new Learning Path, please review Create a Learning Path

  • [x] I have reviewed Create a Learning Path

Please do not include any confidential information in your contribution. This includes confidential microarchitecture details and unannounced product information.

  • [x] I have checked my contribution for confidential information

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the Creative Commons Attribution 4.0 International License.

DavidSpickett avatar Oct 31 '23 17:10 DavidSpickett