Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Thanks Mark. You gave me a great idea.</p> <p>I haven't noticed &amp;&amp;, || can mean logical operators on shell also. It appears '&amp;&amp; afplay ..' works only when 'brew upgrade' returns 0 which happens most of the time, and '|| afplay ..' works only when 'brew upgrade' returns 1 (or any non-zero) meaning error. I decided to use semicolon ';' so afplay can play sound alarm whatever 'brew upgrade' reterns after job done.</p> <pre><code>brew upgrade ; afplay /System/Library/Sounds/Submarine.aiff -v 10 </code></pre> <p>EDIT: Now I use the following code in .profile (or .bashrc), which utilizes the advanced notifier tool, <a href="https://github.com/julienXX/terminal-notifier" rel="nofollow noreferrer"><code>terminal-notifier</code></a>.</p> <pre><code>function brew { caffeinate -s brew $@; terminal-notifier -title 'Homebrew' -subtitle 'Finished' -message brew' '$1' '$2' '$3 -sound 'recv_mail' -contentImage '/Download/Any/Icon/beer_icon.png';} </code></pre> <p>Please note:</p> <ol> <li>There must be a whitespace <em>after</em> the left brace '{' for bash syntax.</li> <li><a href="http://brettterpstra.com/2014/02/20/quick-tip-caffeinate-your-terminal/" rel="nofollow noreferrer"><code>caffeinate</code></a> is used to prevent Mac from falling into sleep mode while brew works for a long time. If you remove 'caffeinate -s', you should rename the function name also.</li> <li>You can install terminal-notifier with brew. -contentImage is optoinal of course.</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload