Class: TRMNLP::Commands::Clone
- Defined in:
- lib/trmnlp/commands/clone.rb
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from TRMNLP::Commands::Base
Instance Method Details
#call(directory_name, id) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/trmnlp/commands/clone.rb', line 7 def call(directory_name, id) authenticate! destination_path = Pathname.new(.dir).join(directory_name) raise Error, "directory #{destination_path} already exists, aborting" if destination_path.exist? Init.new(dir: .dir, skip_liquid: true, quiet: true).call(directory_name) Pull.new(dir: destination_path.to_s, force: true, id: id).call output <<~HEREDOC To start the local server: cd #{Pathname.new(destination_path).relative_path_from(Dir.pwd)} && trmnlp serve HEREDOC end |