How to prevent a Command Line Tool from exiting before asynchronous operation completes

Adding RunLoop.main.run() to the end of the file is one option. More info on another approach using a semaphore here

Leave a Comment