module Dev::Executables::Commands::Status

Public Instance Methods

status(app = nil) click to toggle source

Stampa lo stato dell'app specificata o di tutte le app.

@return [nil]

# File lib/dev/executables/commands/status.rb, line 10
def status(app = nil)
  if app.present?
    apps = [ app ]
  else
    apps = @project.apps
  end

  apps.each do |current_app|
    @project.current_app = current_app
    if @project.valid_app?
      Dir.chdir @project.app_folder
      current_branch = `git rev-parse --abbrev-ref HEAD`

      print "Status of app "
      puts current_app.teal
      puts

      print "\tbranch: "
      print current_branch.limegreen
      print "\tversion: "
      puts @project.app_version.try(:limegreen) || "not found".limegreen
      puts
    end
  end
end