From 28d13c35c9f361c633e4dd0bf45b92db0b867cad Mon Sep 17 00:00:00 2001 From: John Barnette Date: Thu, 4 Oct 2012 21:09:40 -0700 Subject: [PATCH] Add script/boxen-git-credential boxen/puppet-git will need to be taught about this file. --- script/boxen-git-credential | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 script/boxen-git-credential diff --git a/script/boxen-git-credential b/script/boxen-git-credential new file mode 100755 index 0000000..d4a775e --- /dev/null +++ b/script/boxen-git-credential @@ -0,0 +1,33 @@ +#!/usr/bin/ruby +# Provide git credentials using Boxen's config. + +unless command = ARGV.shift + this = File.basename $0 + abort "Usage: #{this} " +end + +# We only support get. + +exit 0 unless command == "get" + +# Make sure we're looking for github.com stuff. + +attrs = Hash[$stdin.read.split($/).map { |l| l.split("=") }] +exit 1 unless attrs["host"] == "github.com" + +require "pathname" + +# Put us where we belong, in the root dir of our boxen repo. + +Dir.chdir Pathname.new(__FILE__).realpath + "../.." + +# Set up our local configuration, deps, and load path. + +load "config/basic.rb" + +require "boxen/config" + +config = Boxen::Config.load + +puts "username=#{config.login}" +puts "password=#{config.password}" -- 1.8.5.3