Class: Maglev::CreateSiteCommand

Inherits:
Rails::Command::Base
  • Object
show all
Defined in:
lib/commands/maglev/create_site_command.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



9
10
11
# File 'lib/commands/maglev/create_site_command.rb', line 9

def self.banner(_command = nil, *)
  'bin/rails maglev:create_site'
end

Instance Method Details

#performObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/commands/maglev/create_site_command.rb', line 13

def perform
  require File.expand_path('config/environment')

  if Maglev::Site.exists?
    say '🤔 You already have a site. 🤔', :yellow
    return
  end

  Maglev::GenerateSite.call(
    theme: Maglev.local_themes.first
  )

  say '🎉 Your site has been created with success!'
end