Sha256: 5c481820f4591bea4b621993456dd8f79d9dff4f0a8738ac15cc94e7483d374a

Contents?: true

Size: 669 Bytes

Versions: 2

Compression:

Stored size: 669 Bytes

Contents

# -*- ruby -*-
# frozen_string_literal: true

require 'mongrel2/config'

require 'mongrel2/cli' unless defined?( Mongrel2::CLI )


# Mongrel2 init command
module Mongrel2::CLI::InitCommand
	extend Mongrel2::CLI::Subcommand

	desc "Initialize a new empty config database."
	command :init do |initcmd|

		initcmd.action do |globals, options, args|
			if Mongrel2::Config.database_initialized?
				exit_now! "Okay, aborting." unless
					prompt.yes?( "Are you sure you want to destroy the current config? " )
			end

			prompt.say( headline_string "Initializing #{globals.config}" )
			Mongrel2::Config.init_database!
		end

	end


end # module Mongrel2::CLI::InitCommand

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongrel2-0.55.0 lib/mongrel2/cli/init.rb
mongrel2-0.54.0 lib/mongrel2/cli/init.rb