bundler-audit
bundler-audit copied to clipboard
Check if the Gemfile.lock path exists before reading
Sometimes a project may not have a Gemfile.lock — and so in these cases when bundler audit is ran in the working directory of a project then the command will simply crash without providing a clean error as to why.
To clean this up, I’ve added a small check for the file’s existence; and upon failure, a reason is printed to the screen as to why and then a non-zero exit code is thrown to signify an error occurred.
I’m open to cleaning this up in a different way / maybe giving a different error or something — but I figure’d this would work for me.