title: How can I safely exit from a non-zero `run` command in a Rails generator?
body: <p>We are creating a Rails generator to add more functionality when creating new Rails apps. At the moment, we have something like the following.</p>
  
  <pre><code>run "bin/yarn add normalize.css"
  </code></pre>
  
  <p>This is fine, but what happens when <code>bin/yarn</code> fails for some reason? Right now, the generator shows a warning and continues to do its things.</p>
  
  <p>We would like to capture any failing response from <code>run</code> and halt the generation.</p>
  
  <p>From some initial investigation, it looks like <code>run</code> does not provide this functionality. Is it even possible with a Rails generator?</p>