title: Restarting OSX app programmatically
body: <p>I need to restart my app in case I reload something that will require a start from the very beginning. I tried this</p>
  
  <pre><code>  let path = NSBundle.mainBundle().resourcePath!.stringByDeletingLastPathComponent.stringByDeletingLastPathComponent
    let task = NSTask()
    task.launchPath = "open"
    task.arguments = [path]
    task.launch()
    exit(0)
  </code></pre>
  
  <p>but I get an error upon the <code>open</code></p>
  
  <blockquote>
    <p>launch path not accessible</p>
  </blockquote>