Commit fc70b4b0a7eb78f6d10d3c58bae274db265575b3
1 parent
bb13917d39
Kill external BUNDLE_ env vars
Showing 1 changed file with 5 additions and 0 deletions Inline Diff
script/boxen-git-credential
| #!/usr/bin/ruby | 1 | 1 | #!/usr/bin/ruby | |
| # Provide git credentials using Boxen's config. | 2 | 2 | # Provide git credentials using Boxen's config. | |
| 3 | 3 | |||
| unless command = ARGV.shift | 4 | 4 | unless command = ARGV.shift | |
| this = File.basename $0 | 5 | 5 | this = File.basename $0 | |
| abort "Usage: #{this} <get|store|erase>" | 6 | 6 | abort "Usage: #{this} <get|store|erase>" | |
| end | 7 | 7 | end | |
| 8 | 8 | |||
| # We only support get. | 9 | 9 | # We only support get. | |
| 10 | 10 | |||
| exit 0 unless command == "get" | 11 | 11 | exit 0 unless command == "get" | |
| 12 | 12 | |||
| # Make sure we're looking for github.com stuff. | 13 | 13 | # Make sure we're looking for github.com stuff. | |
| 14 | 14 | |||
| attrs = Hash[$stdin.read.split($/).map { |l| l.split("=") }] | 15 | 15 | attrs = Hash[$stdin.read.split($/).map { |l| l.split("=") }] | |
| exit 1 unless attrs["host"] == "github.com" | 16 | 16 | exit 1 unless attrs["host"] == "github.com" | |
| 17 | 17 | |||
| require "pathname" | 18 | 18 | require "pathname" | |
| 19 | 19 | |||
| # Put us where we belong, in the root dir of our boxen repo. | 20 | 20 | # Put us where we belong, in the root dir of our boxen repo. | |
| 21 | 21 | |||
| Dir.chdir Pathname.new(__FILE__).realpath + "../.." | 22 | 22 | Dir.chdir Pathname.new(__FILE__).realpath + "../.." | |
| 23 | 23 | |||
| 24 | # Because we can be called from inside other Ruby processes, unset any | |||
| 25 | # `BUNDLE_` environment variables. |