fix pre-commit hook checking for changed js files

My bash complains when js_files is an empty string here. The ! -z checks for non-emptyness.