修訂 | 7ae3cf11fb60653f4d3b35cc621de7760e0be251 (tree) |
---|---|
時間 | 2016-03-15 20:49:35 |
作者 | Tatsuki Sugiura <sugi@nemu...> |
Commiter | Tatsuki Sugiura |
Stop to launch web brwoser on non-x11 env.
@@ -1,5 +1,11 @@ | ||
1 | 1 | 2016-03-15 Tatsuki Sugiura <sugi@nemui.org> |
2 | 2 | |
3 | + * Version 0.0.4 | |
4 | + * login: stop to launch web browser on non-X11 environment. | |
5 | + | |
6 | +2016-03-15 Tatsuki Sugiura <sugi@nemui.org> | |
7 | + | |
8 | + * Version 0.0.3 | |
3 | 9 | * frs_upload: show upload progres in verbose mode. |
4 | 10 | * frs_upload: validates file digest after upload. |
5 | 11 |
@@ -31,12 +31,14 @@ module OSDN; module CLI; module Command | ||
31 | 31 | |
32 | 32 | def launch_brwoser(url) |
33 | 33 | puts "Access follwoing URL to get auth code;\n#{url}" |
34 | - %w(/usr/bin/xdg-open /usr/bin/X11/xdg-open /usr/local/bin/xdg-open | |
35 | - /usr/bin/x-www-browser /usr/bin/firefox /usr/local/bin/firefox | |
36 | - ).each do |bin| | |
37 | - File.executable?(bin) or next | |
38 | - exec(bin, url) if fork.nil? | |
39 | - return | |
34 | + if ENV['DISPLAY'] | |
35 | + %w(/usr/bin/xdg-open /usr/bin/X11/xdg-open /usr/local/bin/xdg-open | |
36 | + /usr/bin/x-www-browser /usr/bin/firefox /usr/local/bin/firefox | |
37 | + ).each do |bin| | |
38 | + File.executable?(bin) or next | |
39 | + exec(bin, url) if fork.nil? | |
40 | + return | |
41 | + end | |
40 | 42 | end |
41 | 43 | case RUBY_PLATFORM |
42 | 44 | when /mswin|msys|mingw|cygwin|bccwin|wince|emc/ |
@@ -1,5 +1,5 @@ | ||
1 | 1 | module OSDN |
2 | 2 | module CLI |
3 | - VERSION = "0.0.3" | |
3 | + VERSION = "0.0.4" | |
4 | 4 | end |
5 | 5 | end |