Class: Zapnito::Cli::Commands::Environment

Inherits:
Thor
  • Object
show all
Defined in:
lib/zapnito/cli/commands/environment.rb

Direct Known Subclasses

DevelopmentTheme, ProductionTheme, StageTheme

Instance Method Summary collapse

Instance Method Details

#previewObject



36
37
38
39
40
41
# File 'lib/zapnito/cli/commands/environment.rb', line 36

def preview
  theme = Services.local.load
  link = zapnito.preview_link(theme)
  puts "link: #{link}"
  Launchy.open(link)
end


29
30
31
32
33
# File 'lib/zapnito/cli/commands/environment.rb', line 29

def preview_link
  theme = Services.local.load
  link = zapnito.preview_link(theme)
  puts "---> #{link}"
end

#publishObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/zapnito/cli/commands/environment.rb', line 11

def publish
  theme = Services.local.load
  puts "---> Publishing #{theme.tenant_slug}"

  release_config = zapnito.s3_upload_urls_for_theme(theme)
  Services.s3.upload_theme(theme, release_config)
  zapnito.build_release(theme)

  puts "---> Published #{theme.tenant_slug}/#{theme.revision}"
rescue Exception => e
  if e.try(:response).try(:code) == 406
    show_sass_error(e)
  else
    raise e
  end
end