Posts for: #bash

Load pull request (branch diff) files in PhpStorm

Stick this in your .bash_profile or .bashrc file: function diffopen() { git diff --name-only "$1" | xargs -d '\n' pstorm; } Then in your project folder, say you want to open all files that differ from your master branch: diffopen master Note, on OSX you’ll need the GNU version of xargs for this to work, as I discovered the hard way..
[Read more]

Cron gotcha

While pondering why my backup scripts weren’t working in /etc/cron.daily, I remembered that run-parts (the thing that runs stuff in that directory) doesn’t like running scripts with a .sh, or indeed probably any extension on them. Handy to remember that one!
[Read more]