Skip to content

Commit

Permalink
Update environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Amaël Sikel authored and cesarferreira committed Nov 25, 2020
1 parent 8794d8a commit 5644cf3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/dryrun.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ def pick_device
@device = nil

if !Gem.win_platform?
@sdk = `echo $ANDROID_HOME`.delete("\n")
@sdk = `echo $ANDROID_SDK_ROOT`.delete("\n")
else
@sdk = `echo %ANDROID_HOME%`.delete("\n")
@sdk = `echo %ANDROID_SDK_ROOT%`.delete("\n")
end

@sdk = 'adb' if @sdk.empty?

$sdk = @sdk

puts 'Searching for devices...'.yellow
Expand Down Expand Up @@ -142,11 +142,11 @@ def pick_device
puts "Picked #{@device.name.to_s.green}" unless @device.nil?
end

def android_home_is_defined
def ANDROID_SDK_ROOT_is_defined
@sdk = if !Gem.win_platform?
`echo $ANDROID_HOME`.delete('\n')
`echo $ANDROID_SDK_ROOT`.delete('\n')
else
`echo %ANDROID_HOME%`.delete('\n')
`echo %ANDROID_SDK_ROOT%`.delete('\n')
end
!@sdk.empty?
end
Expand All @@ -160,9 +160,9 @@ def wipe_temporary_folder
end

def call
unless android_home_is_defined
puts "\nWARNING: your #{'$ANDROID_HOME'.yellow} is not defined\n"
puts "\nhint: in your #{'~/.bashrc'.yellow} or #{'~/.bash_profile'.yellow} add:\n #{"export ANDROID_HOME='/Users/cesarferreira/Library/Android/sdk/'".yellow}"
unless ANDROID_SDK_ROOT_is_defined
puts "\nWARNING: your #{'$ANDROID_SDK_ROOT'.yellow} is not defined\n"
puts "\nhint: in your #{'~/.bashrc'.yellow} or #{'~/.bash_profile'.yellow} add:\n #{"export ANDROID_SDK_ROOT='/Users/cesarferreira/Library/Android/sdk/'".yellow}"
puts "\nNow type #{'source ~/.bashrc'.yellow}\n\n"
exit 1
end
Expand Down

0 comments on commit 5644cf3

Please sign in to comment.