mirror of
https://github.com/minio/minio.git
synced 2024-12-27 07:35:55 -05:00
eb7c690ea9
This PR allows 'minio update' to not only shows update banner but also allows for in-place upgrades. Updates are done safely by validating the downloaded sha256 of the binary. Fixes #4781
26 lines
462 B
Go
26 lines
462 B
Go
// +build !solaris
|
|
|
|
package gopass
|
|
|
|
import "golang.org/x/crypto/ssh/terminal"
|
|
|
|
type terminalState struct {
|
|
state *terminal.State
|
|
}
|
|
|
|
func isTerminal(fd uintptr) bool {
|
|
return terminal.IsTerminal(int(fd))
|
|
}
|
|
|
|
func makeRaw(fd uintptr) (*terminalState, error) {
|
|
state, err := terminal.MakeRaw(int(fd))
|
|
|
|
return &terminalState{
|
|
state: state,
|
|
}, err
|
|
}
|
|
|
|
func restore(fd uintptr, oldState *terminalState) error {
|
|
return terminal.Restore(int(fd), oldState.state)
|
|
}
|