25 lines
549 B
Ruby
Executable File
25 lines
549 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
require 'thor'
|
|
require_relative 'cli/commands/backup_command'
|
|
|
|
module DiscourseCLI
|
|
class Main < Thor
|
|
desc "backup SUBCOMMAND", "Create, restore and manage backups"
|
|
subcommand "backup", BackupCommand
|
|
|
|
def self.exit_on_failure?
|
|
true
|
|
end
|
|
end
|
|
|
|
def self.load_rails
|
|
puts "Loading Rails..."
|
|
Dir.chdir(File.expand_path("..", __dir__)) # rubocop:disable Discourse/NoChdir
|
|
require File.expand_path("../config/environment", __dir__)
|
|
end
|
|
end
|
|
|
|
DiscourseCLI::Main.start
|