class Azuki::Command::Git

manage git for apps

Public Instance Methods

clone() click to toggle source
git:clone APP [DIRECTORY]

clones a azuki app to your local machine at DIRECTORY (defaults to app name)

-r, --remote REMOTE  # the git remote to create, default "azuki"

Examples:

$ azuki git:clone example
Cloning from app 'example'...
Cloning into 'example'...
remote: Counting objects: 42, done.
...
# File lib/azuki/command/git.rb, line 21
def clone
  remote = options[:remote] || "azuki"

  name = options[:app] || shift_argument || error("Usage: azuki git:clone APP [DIRECTORY]")
  directory = shift_argument
  validate_arguments!

  git_url = api.get_app(name).body["git_url"]

  puts "Cloning from app '#{name}'..."
  system "git clone -o #{remote} #{git_url} #{directory}".strip
end
remote() click to toggle source
git:remote [OPTIONS]

adds a git remote to an app repo

if OPTIONS are specified they will be passed to git remote add

-r, --remote REMOTE        # the git remote to create, default "azuki"

Examples:

$ azuki git:remote -a example
Git remote azuki added

$ azuki git:remote -a example
!    Git remote azuki already exists
# File lib/azuki/command/git.rb, line 52
def remote
  git_options = args.join(" ")
  remote = options[:remote] || 'azuki'

  if git('remote').split("\n").include?(remote)
    error("Git remote #{remote} already exists")
  else
    app_data = api.get_app(app).body
    create_git_remote(remote, app_data['git_url'])
  end
end