From f978814bb1414126adedc798fbb6ec3f7c820c78 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Fri, 24 Sep 2010 21:01:18 +0100 Subject: [PATCH] Improve entry of username and password for scp upload. --- buildSrc/src/main/groovy/TarUpload.groovy | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/buildSrc/src/main/groovy/TarUpload.groovy b/buildSrc/src/main/groovy/TarUpload.groovy index e1f4126a69..ab0234865e 100644 --- a/buildSrc/src/main/groovy/TarUpload.groovy +++ b/buildSrc/src/main/groovy/TarUpload.groovy @@ -64,11 +64,12 @@ class Login extends DefaultTask { @TaskAction login() { - project.ant { - input("Please enter the ssh username for host '$host'", addproperty: "user.$host") - input("Please enter the ssh password '$host'", addproperty: "pass.$host") + def console = System.console() + if (console) { + username = console.readLine("\nPlease enter the ssh username for host '$host': ") + password = new String(console.readPassword("Please enter the ssh password for '$host': ")) + } else { + logger.error "Unable to access System.console()." } - username = ant.properties["user.$host"] - password = ant.properties["pass.$host"] } }