julienXX / terminal-notifier

Send User Notifications on macOS from the command-line.
Other
6.37k stars 330 forks source link

Adding Terminal Notifier to a Makefile build #210

Closed marcastel closed 7 years ago

marcastel commented 7 years ago

Hello Julien. Came across your utility and liked it. Thanks.

I needed to include it in a Makefile build. Here is my quick and dirty Makefile wrapper. Include the following snippet in a file named Makefile at the top of your repo.

PROJECT     =  Terminal Notifier.xcodeproj
SCHEME      =  Terminal Notifier
OUTDIR      = $(HOME)/Library/Developer/Xcode/DerivedData

.PHONY: all list build

all: build

list:
    xcodebuild -list -project "$(PROJECT)"

build:
    xcodebuild -scheme "$(SCHEME)" build && \
    app=`ls -1drt $(OUTDIR)/Terminal_Notifier-*/Build/Products/Release/terminal-notifier.app | tail -1` && \
    test -n "$$app" && sudo mv "$$app" /Applications/

Then simply type

make

from the command line.

Note: This is a quick and dirty hack. I am interested in making this more robust if it is of interest to others.

PS: Why use make(1) rather than Xcode ? Because I currently have an automated build system -- that means with no user interaction or GUI applications, for all the Open Source applications I use on MacOS (e.g. MacVim, Spectacle, ...)

julienXX commented 7 years ago

@marcastel thanks for the Makefile, I'll leave the issue here in case others are interested.