Commit 5eb3df2a9fbcf927fd5fd2e04b58a912774f488b

Authored by Will Farrington

Merge remote-tracking branch 'origin/credential-cache' into enable_puppet

Showing 1 changed file Inline Diff

script/boxen-git-credential
File was created 1 #!/usr/bin/ruby
2 # Provide git credentials using Boxen's config.
3
4 unless command = ARGV.shift
5 this = File.basename $0
6 abort "Usage: #{this} <get|store|erase>"
7 end
8
9 # We only support get.
10
11 exit 0 unless command == "get"
12
13 # Make sure we're looking for github.com stuff.
14
15 attrs = Hash[$stdin.read.split($/).map { |l| l.split("=") }]
16 exit 1 unless attrs["host"] == "github.com"
17
18 require "pathname"
19
20 # Put us where we belong, in the root dir of our boxen repo.