7b1420243e
By default, the prove(1) program looks for tests to run in the 't' directory at the repository root, so let's put existing tests there in order to remove a non-default argument from prove.
30 lines
462 B
Go
30 lines
462 B
Go
// +build testtools
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
func main() {
|
|
prompt := strings.Join(os.Args[1:], " ")
|
|
|
|
var answer string
|
|
|
|
if strings.Contains(prompt, "Username") {
|
|
answer = "user"
|
|
if env, ok := os.LookupEnv("LFS_ASKPASS_USERNAME"); ok {
|
|
answer = env
|
|
}
|
|
} else if strings.Contains(prompt, "Password") {
|
|
answer = "pass"
|
|
if env, ok := os.LookupEnv("LFS_ASKPASS_PASSWORD"); ok {
|
|
answer = env
|
|
}
|
|
}
|
|
|
|
fmt.Println(answer)
|
|
}
|