This entry was posted in Debugging and tagged debugging, PHP on Jby J.D. Now whenever there is a PHP error, you will get a notification, and when you click on it the Terminal app will be brought to the front so you can see the error. You’ll want to replace ~/zebug.log with the path of the log file that you want to listen to, of course. If you have Homebrew installed, all you need to do is run: If Snap isnt installed, you can install it on Ubuntu-based distributions with the command: sudo apt-get install snapd -y. Install terminal-notifier.app (default) When using tmux on Yosemite: reattach-to-user-namespace is required to prevent terminal-notifier from hanging (see julienXX/terminal-notifier115 for details). I found this thread on SO, which helped me solve my problem. To overcome this, I thought it would be nice if I could get a popup notification each time there was an error, just like many Mac apps do. However, sometimes I don’t realize that new errors have been logged right away, which is annoying. I always have Terminal open and tail watching this file. I ended up moving the numbers around and that seemed to address the issue.I have PHP configured to log all of its errors to a single log file. It initially wouldn’t give the message, and instead was using the default img that is included with the script. The difficult part about this was getting the script to return the proper notifications. I’ll likely not use this for larger projects, or at least implement a count that only runs the tests every so often. That’s not a lot, but if the project was much bigger, say 30-40 tests, I can see this being a dumb idea. This will likely not be the best way to address phpunit tests, especially since currently there are only 3 tests. Which should return a notification of some sort. You can run gulp, or you can use gulp test : I lost the link to this gist, so it’s removed. Note: Can be edited from host or guest machine, since in my case the gulp file will be at the base of my project folder. I gathered this from a couple of different gulp.js files. Used NPM for this on my Vagrant VM, since this is where gulp will be called: I believe the gulp-notify sends more by default now. These are the numbers that worked for me, YMMV. This is the part where I couldn’t quite get it to work like in the tutorial I included, so I ended up moving around the numbers that were being submitted to the script from gulp. I used homebrew, so I just ran update and installed terminal-notifier: A fix to actually find and use the terminal notifier app Add an additional check if it wasnt found to skip running the command. The bundle identifier for this application is nl. The tests are also running against the VM’s databases, not the local machine, so it makes more sense to keep dev separate from the Host Mac OSX. Commonly, this applications installer has the following filename: terminal-notifier1.4.2.zip. I develop using a Vagrant VM, so while installing most of this stuff on the host machine will work fine, I want it to be mostly kept to the VM. Note: I haven’t really seen anything relating to this other than this, but I couldn’t quite get it to work using his bash script, so I ended up a making a few adjustments to his. I’ve been looking using grunt/gulp for automation of my different tasks, such as css/js minification, and image manipulations so when I found out about automating tests for phpunit, I decided to give a try. It doesn’t freeze, it continues to load, but it is one little weirdness that I’ve found. However, I notice that the server hangs at provisioning on terminal. brew install terminal-notifier 1.1.3Cocoa emacs, emacsclient This method talks to emacs using emacsclient -e to execute code in the emacs session, which requires that you run your emacs session using emacs -daemon(or using M-x start-serveronce emacs is already started) and emacsclient. I can confirm that this does in fact work with homestead and elixir. Stephen Quick Notifications Using Gulp-Notify on Vagrant with Terminal-Notifier
0 Comments
Leave a Reply. |