Skip to content

Commit 188cd07

Browse files
author
Dimitar Tachev
authored
Merge pull request #18 from preethamvishy/cli/steps
Mac: CLI lists installations to be performed. Added step count.
2 parents 661195e + ff0f978 commit 188cd07

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

native-script.rb

Lines changed: 17 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", "Open JDK 8", "Android SDK", "Android emulator system image", "HAXM (Hardware accelerated Android emulator)", "Android emulator", "CocoaPods", "CocoaPods setup", "pip", "six", "xcodeproj"]
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
@@ -151,8 +162,12 @@ def install_android_package(name)
151162
install_android_package("extras;android;m2repository")
152163
install_android_package("extras;google;m2repository")
153164

165+
puts "Step #{$count} of #{$tasks.length}:"
166+
$count += 1
154167
puts "Do you want to install Android emulator system image? (y/n)"
155168
if $silentMode || gets.chomp.downcase == "y"
169+
puts "Step #{$count} of #{$tasks.length}:"
170+
$count += 1
156171
puts "Do you want to install HAXM (Hardware accelerated Android emulator)? (y/n)"
157172
if $silentMode || gets.chomp.downcase == "y"
158173
execute("echo y | #{sdk_manager} \"extras;intel;Hardware_Accelerated_Execution_Manager\" | grep -v = || true", "Failed to download Intel HAXM.")
@@ -162,6 +177,8 @@ def install_android_package(name)
162177
end
163178
end
164179

180+
puts "Step #{$count} of #{$tasks.length}:"
181+
$count += 1
165182
puts "Do you want to create Android emulator? (y/n)"
166183
if $silentMode || gets.chomp.downcase == "y"
167184
error_msg = "Failed to create Android emulator."

0 commit comments

Comments
 (0)