2016-03-15 Tatsuki Sugiura <sugi@nemui.org>
+ * Version 0.0.4
+ * login: stop to launch web browser on non-X11 environment.
+
+2016-03-15 Tatsuki Sugiura <sugi@nemui.org>
+
+ * Version 0.0.3
* frs_upload: show upload progres in verbose mode.
* frs_upload: validates file digest after upload.
def launch_brwoser(url)
puts "Access follwoing URL to get auth code;\n#{url}"
- %w(/usr/bin/xdg-open /usr/bin/X11/xdg-open /usr/local/bin/xdg-open
- /usr/bin/x-www-browser /usr/bin/firefox /usr/local/bin/firefox
- ).each do |bin|
- File.executable?(bin) or next
- exec(bin, url) if fork.nil?
- return
+ if ENV['DISPLAY']
+ %w(/usr/bin/xdg-open /usr/bin/X11/xdg-open /usr/local/bin/xdg-open
+ /usr/bin/x-www-browser /usr/bin/firefox /usr/local/bin/firefox
+ ).each do |bin|
+ File.executable?(bin) or next
+ exec(bin, url) if fork.nil?
+ return
+ end
end
case RUBY_PLATFORM
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/