7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/selenium-prep/system/path.rb', line 7
def self.set
ConfigChecker.new
case ENV['SE_OS_TYPE']
when 'win32', 'win64'
system("set path=%path%;#{ENV['SE_DOWNLOAD_LOCATION']}")
system('reg.exe ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path /t REG_EXPAND_SZ /d %path% /f')
broadcast_windows_system_message
ENV['PATH'] = "#{ENV['PATH']};#{ENV['SE_DOWNLOAD_LOCATION']}"
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
|