Run Makefile from Finder
You could use a function like this:
fmake() {
cd "$(osascript -e 'tell application "Finder"
POSIX path of (target of Finder window 1 as alias)
end tell' 2> /dev/null)"
make && make install
}
Or save a function just for the cd command and use history-search-backward to run something like cdf && make && make install
.
Or open Automator, choose the Service template, set the input type to no input, and add a Run AppleScript action like this:
try
tell application "Finder"
POSIX path of (target of Finder window 1 as alias)
end tell
tell application "Terminal"
do script "cd " & quoted form of result & " && make && make install"
activate
end tell
end
Without the try block Automator would show an error dialog if the script exits with an error.