In a previous project I used a bash script in conjunction with a git hook to concatenate all my js files and increment build numbers in html file references (cache-kill) after every commit. This was convenient at first, but quickly got annoying as I wasn’t always committing js file changes. I eventually opted to just call the script manually before any deployment to qa or production, thinking I would automate it again one day to only be called when JS files were changed (git hooks probably provide this info).

Today I read up on make. I’ve always used make in the past to build versions of a program for my system but never how it actually worked. When ran, it essentially reads in a list of dependencies, and if the source files have modification times newer than the “built” file, it runs your script to rebuild them. Concatenating javascript files seems like the perfect opportunity for this. I’ll rewrite my bash script to use make, set it as a git hook, and should be able to forget it. Will let you know how it goes.