skybet / cali

Cali Automation Layout Initialiser
MIT License
32 stars 7 forks source link

Automatically detect whether a TTY is necessary (i.e. -N, --non-interactive) #11

Closed lucymhdavies closed 6 years ago

lucymhdavies commented 6 years ago

Example code from pscli:

        //  https://rosettacode.org/wiki/Check_output_device_is_a_terminal#Go
        // If output is a terminal...
        if terminal.IsTerminal(int(os.Stdout.Fd())) {
            // use user's preference for interactive/nonInteractive Docker
            docker.NonInteractive = nonInteractive
        } else {
            // If not, then default to nonInteractive
            docker.NonInteractive = true
        }

At this point, there's (probably) no need for the -N flag.

lucymhdavies commented 6 years ago

Was added in v0.2.0