Skip to content

Commit 78d4af1

Browse files
committed
CLI lists installations to be performed. Added step count for installations.
1 parent 4d7e8a9 commit 78d4af1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

native-script.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@
3939
puts "You need to accept the Xcode license agreement to be able to use the Xcode command-line tools."
4040
system('xcodebuild -license')
4141
end
42+
43+
$tasks = ["Homebrew", "Google Chrome", "Java SE Development Kit 8", "Android SDK", "CocoaPods", "CocoaPods", "pip", "six", "xcodeproj", "Android emulator", "HAXM (Hardware accelerated Android emulator)"]
44+
$count = 1
45+
puts "This setup script will request to install the following on your machine:"
46+
$tasks.each_with_index do |st, index|
47+
puts "#{index + 1}. #{st}"
48+
end
49+
4250
# Help with installing other dependencies
4351

4452

@@ -62,6 +70,9 @@ def execute(script, warning_message, run_as_root = false)
6270
end
6371

6472
def install(program_name, message, script, run_as_root = false, show_all_option = true)
73+
puts "Step #{$count} of #{$tasks.length}:"
74+
$count += 1
75+
6576
if $answer != "a"
6677
puts "Allow the script to install " + program_name + "?"
6778
if show_all_option
@@ -153,8 +164,12 @@ def install_environment_variable(name, value)
153164
execute("echo y | #{sdk_manager} \"extras;android;m2repository\"", error_msg)
154165
execute("echo y | #{sdk_manager} \"extras;google;m2repository\"", error_msg)
155166

167+
puts "Step #{$count} of #{$tasks.length}:"
168+
$count += 1
156169
puts "Do you want to install Android emulator? (y/n)"
157170
if $silentMode || gets.chomp.downcase == "y"
171+
puts "Step #{$count} of #{$tasks.length}:"
172+
$count += 1
158173
puts "Do you want to install HAXM (Hardware accelerated Android emulator)? (y/n)"
159174
if $silentMode || gets.chomp.downcase == "y"
160175
execute("echo y | #{sdk_manager} \"extras;intel;Hardware_Accelerated_Execution_Manager\"", error_msg)

0 commit comments

Comments
 (0)