whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Support password-from-stdin
Date Fri, 05 Jun 2020 12:31:21 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new f5924b8  Support password-from-stdin
f5924b8 is described below

commit f5924b8118c63b65226305e9009481af2b024b48
Author: Sebb <sebb@apache.org>
AuthorDate: Fri Jun 5 13:30:58 2020 +0100

    Support password-from-stdin
---
 lib/whimsy/asf/svn.rb | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb
index 5d3ec31..93e0218 100644
--- a/lib/whimsy/asf/svn.rb
+++ b/lib/whimsy/asf/svn.rb
@@ -296,16 +296,23 @@ module ASF
         end
       end
 
+      open_opts = {}
       # password was supplied, add credentials
       password = options[:password]
       if password
-        cmd += ['--username', options[:user], '--password', password, '--no-auth-cache']
+        cmd += ['--username', options[:user], '--no-auth-cache']
+        if ASF::Config[:password_from_stdin] # TODO: better way to check this?
+          open_opts[:stdin_data] = password
+          cmd << '--password-from-stdin'
+        else
+          cmd += ['--password', password]
+        end
       end
 
       p cmd if options[:verbose]
 
       # issue svn command
-      out, err, status = Open3.capture3(*cmd)
+      out, err, status = Open3.capture3(*cmd, open_opts)
       if status.success?
         return out
       else


Mime
View raw message