Provided automation on pre-commit hook.

When one does npm install (which is essential), the pre-commit hook is
copied to the .git/hooks folder if it exists (in some cases it might
not -- e.g. prod instance).

Also added better error handling on the pre-commit hook itself.