Class: Zillabyte::Command::Git

Inherits:
Base
  • Object
show all
Defined in:
lib/zillabyte/cli/git.rb

Overview

manage git for apps

Constant Summary

Constants inherited from Base

Base::META_COLUMNS

Instance Attribute Summary

Attributes inherited from Base

#args, #options

Instance Method Summary collapse

Methods inherited from Base

alias_command, #api, extract_banner, extract_description, extract_help, extract_help_from_caller, extract_options, extract_summary, inherited, #initialize, method_added, namespace

Methods included from Helpers

#add_git_remote, #app, #ask, #create_git_remote, #display, #error, #extract_app_from_git_config, #extract_app_in_dir, #format_with_bang, #get_flow_name, #git, #handle_downloading_manifest, #has_git?, #longest, #read_multiline, #with_tty

Constructor Details

This class inherits a constructor from Zillabyte::Command::Base

Instance Method Details

#remote ⇒ Object

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 "Zillabyte" -n, --name NAME # The name of the app, default current directory's name

Examples:

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

$ zillabyte git:remote -a example ! Git remote zillabyte already exists



23
24
25
26
27
28
29
30
31
32
# File 'lib/zillabyte/cli/git.rb', line 23

def remote
  
  git_options = args.join(" ")
  remote = options[:remote] || 'zillabyte'
  name = options[:name] || get_flow_name()
  error "could not infer app name" if name.nil? 
  
  add_git_remote(name, remote)
  
end