Skip to content

Commit

Permalink
hacks for password changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zenspider committed Nov 22, 2013
1 parent d509400 commit 0ba5409
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FAST = ENV['FAST']

COLLABORATORS = %w(zenspider)
GITHUB_USER = `git config --global github.user`.chomp
GITHUB_PASS = `git config --global github.password`.chomp
GITHUB_PASS = File.read File.expand_path "~/.gitconfig.passwd"
GITHUB_ORG = "seattlerb"
GITHUB_TOKEN = IO.read("token.txt").strip rescue nil
GIT_P4 = File.expand_path "vendor/git-p4"
Expand Down Expand Up @@ -52,7 +52,9 @@ def paged_json_array url
result = []

begin
req = URI.parse(url).open "User-Agent" => "FUCK YOU"
warn "url: #{url}" if TRACE

req = URI.parse(url).open "User-Agent" => "omfg.seattlerb.org"
link = link_hash req.meta["link"]
url = link["next"]

Expand Down Expand Up @@ -103,15 +105,15 @@ task :pull do
end

task :push do
warn "Getting repos..." if TRACE

url = "https://api.github.com/orgs/#{GITHUB_ORG}/repos"
repos = paged_json_array(url).map { |r| r["name"] }
p repos.sort if TRACE

projects.each do |name, project|
name.downcase!

warn "Pushing #{name} to GitHub." if TRACE

unless repos.include? name
warn " - Creating a new repo!" if TRACE

Expand All @@ -123,6 +125,8 @@ task :push do
!system("git diff --quiet origin/master")

if should_push then
warn "Pushing #{name} to GitHub." if TRACE

sleep rand(30) unless FAST
git "push origin master"
end
Expand Down

0 comments on commit 0ba5409

Please sign in to comment.