Sha256: 428dc17fd509f780cd760833b4ea72ee13e4cc8dbf70dd7d0fc9546b8ccd26b4

Contents?: true

Size: 1023 Bytes

Versions: 6

Compression:

Stored size: 1023 Bytes

Contents

if `which hub`.strip == ""
  say_custom "hub", "Please install hub. https://github.com/defunkt/hub"
  exit 1
end

after_everything do
  github_private = multiple_choice "Create a GitHub repository?", [["Public", false], ["Private", true]]
  
  # Usage: hub create [NAME] [-p] [-d DESCRIPTION] [-h HOMEPAGE]
  
  tried_create_already = false
  while (@git_uri = `git config remote.origin.url`.strip) && @git_uri.size == 0
    if tried_create_already
      @repo_name = ask_wizard "Repository #{@repo_name} already exists. What project name?"
    else
      @repo_name = File.basename(File.expand_path("."))
    end
    if github_private
      run "hub create #{@repo_name} -p"
    else
      run "hub create #{@repo_name}"
    end
    tried_create_already = true
  end
  run "git push origin master"
  
  say_custom "github", "Created repo #{@git_uri}"
end

__END__

name: GitHub
description: Push project to new GitHub repository
author: drnic

category: deployment
exclusive: scm-hosting

requires: [git]
run_after: [git]

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
appscrolls-0.11.2 scrolls/github.rb
appscrolls-0.11.1 scrolls/github.rb
appscrolls-0.11.0 scrolls/github.rb
appscrolls-0.10.1 scrolls/github.rb
appscrolls-0.10.0 scrolls/github.rb
appscrolls-0.9.0 scrolls/github.rb