Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GoCD should be a good command line citizen and handle STDIN redirection #6

Open
marques-work opened this issue Jan 15, 2019 · 0 comments

Comments

@marques-work
Copy link
Collaborator

Some of this has been written in terms of helpers (see utils/terminal.go):

func HasShellPipe() bool {
	fi, _ := os.Stdin.Stat()
	return (fi.Mode() & os.ModeCharDevice) == 0
}

func UseXargsOverPipe(rawArgs []string) error {
	if HasShellPipe() {
		return &MustUseXargs{Invocation: rawArgs}
	}
	return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant