samedi 6 décembre 2014

Git pre-commit hook that checks for open application


I am using git to manage a project that has a few binary files that need to be closed before being committed. So I need a git hook, that checks to see if the application that has these files open is running.


My thought was to use osascript like this



#!/usr/bin/env osascript

tell application "System Events"
set apps to the name of every process whose background only is false
-- check if apps contains the target application
-- show a message and exit with non zero status if it does
-- otherwise exit with 0
end tell


but I am not having much luck. How could I make this work as a git pre-commit hook?





Aucun commentaire:

Enregistrer un commentaire