7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/selenium-prep/system/path.rb', line 7
def self.set
ConfigChecker.new
case ENV['SE_OS_TYPE']
when 'win32', 'win64'
ENV['PATH'] = "#{ENV['PATH']};#{ENV['SE_DOWNLOAD_LOCATION']}"
require 'win32/registry'
Win32::Registry::HKEY_LOCAL_MACHINE.open(
"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment",
Win32::Registry::KEY_WRITE) do |key|
key['PATH'] = ENV['PATH']
end
broadcast_windows_system_message
when 'mac32', 'linux32', 'linux64'
unless set?
unless bash_updated?
system("echo 'export PATH=$PATH:#{ENV['SE_DOWNLOAD_LOCATION']}' | sudo tee -a ~/.bash_profile")
end
system('source ~/.bash_profile')
ENV['PATH'] = "#{ENV['PATH']}:/#{ENV['SE_DOWNLOAD_LOCATION']}"
end
end
end
|