Module: Carson::Runtime::Setup

Included in:
Carson::Runtime
Defined in:
lib/carson/runtime/setup.rb

Overview

First-time setup, onboard, offboard, and refresh operations.

Constant Summary collapse

WELL_KNOWN_REMOTES =
%w[origin github upstream].freeze

Instance Method Summary collapse

Instance Method Details

#setup!(cli_choices: {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/carson/runtime/setup.rb', line 11

def setup!( cli_choices: {} )
	puts_verbose ""
	puts_verbose "[Setup]"

	unless inside_git_work_tree?
		puts_line "WARN: not a git repository. Skipping remote and branch detection."
		return write_setup_config( choices: cli_choices )
	end

	unless cli_choices.empty?
		return write_setup_config( choices: cli_choices )
	end

	if input_stream.respond_to?( :tty? ) && input_stream.tty?
		interactive_setup!
	else
		silent_setup!
	end
end