#!/usr/bin/env ruby

require "shellwords"

# Valid commands are: `get`, `store`, `erase`. We only want to let `get`
# through, as the others mutate the credential store.
if ARGV.include?("get")
  args = ARGV.map { |arg| Shellwords.escape(arg) }.join(" ")
  exec "git credential-store #{args}"
end
