Class: Sutty::Cli::Commands::Theme

Inherits:
Sutty::Cli::Command show all
Defined in:
lib/sutty/cli/commands/theme.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Sutty::Cli::Command

#command, #cursor, #editor, #exec_exist?, #generator, #pager, #platform, #prompt, #screen, #which

Constructor Details

#initialize(name, options) ⇒ Theme

Returns a new instance of Theme.



12
13
14
15
# File 'lib/sutty/cli/commands/theme.rb', line 12

def initialize(name, options)
  @name = name
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/sutty/cli/commands/theme.rb', line 10

def name
  @name
end

Instance Method Details

#execute(input: $stdin, output: $stdout) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/sutty/cli/commands/theme.rb', line 17

def execute(input: $stdin, output: $stdout)
  cmd.run('git clone https://0xacab.org/sutty/jekyll/sutty-base-jekyll-theme.git', theme_name)

  Dir.chdir theme_name do
    cmd.run('git remote rename origin upstream')
    cmd.run('git remote add origin', origin)
    cmd.run('git push -u origin master')
    cmd.run('bundle install')
    cmd.run('yarn install')
    cmd.run('git mv sutty-base-jekyll-theme.gemspec', gemspec)
  end
end