OSDN Git Service

Runnable on win32 environment.
authorTatsuki Sugiura <sugi@nemui.org>
Mon, 1 May 2017 05:05:48 +0000 (14:05 +0900)
committerTatsuki Sugiura <sugi@nemui.org>
Mon, 1 May 2017 05:05:48 +0000 (14:05 +0900)
lib/osdn/cli.rb
lib/osdn/cli/command/login.rb

index 47962cd..5980973 100644 (file)
@@ -70,7 +70,7 @@ module OSDN
               logger.error "Invalid ownership of credential file #{credential_path}, skip loading."
               return
             end
-            unless (stat.mode & 0777).to_s(8) == "600"
+            if RUBY_PLATFORM !~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/ && (stat.mode & 0777).to_s(8) != "600"
               logger.error "Invalid permission #{(stat.mode & 0777).to_s(8)} of credential file #{credential_path}, skip loading."
               return
             end
index 0ea6cec..8721683 100644 (file)
@@ -42,7 +42,7 @@ module OSDN; module CLI; module Command
       end
       case RUBY_PLATFORM
       when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
-        exec("start #{url}") if fork.nil?
+        spawn("start #{url.gsub(/&/, '^&')}")
       when /darwin|mac os/
         exec("/usr/bin/open", url) if fork.nil?
       end