1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-06 02:23:24 +00:00

build: make rclone build with wasm

Needed to drop
- azureblob backend
- cache backend
- qingstor backend
- cachestats command
- ncdu command
This commit is contained in:
Nick Craig-Wood
2020-07-31 19:57:48 +01:00
parent ac044b1c54
commit 3a14b1d5a9
34 changed files with 96 additions and 50 deletions

View File

@@ -9,7 +9,6 @@ import (
"sync"
colorable "github.com/mattn/go-colorable"
"golang.org/x/crypto/ssh/terminal"
)
// VT100 codes
@@ -72,7 +71,7 @@ var (
func Start() {
once.Do(func() {
f := os.Stdout
if !terminal.IsTerminal(int(f.Fd())) {
if !IsTerminal(int(f.Fd())) {
// If stdout not a tty then remove escape codes
Out = colorable.NewNonColorable(f)
} else if runtime.GOOS == "windows" && os.Getenv("TERM") != "" {
@@ -89,16 +88,6 @@ func WriteString(s string) {
Write([]byte(s))
}
// GetSize reads the dimensions of the current terminal or returns a
// sensible default
func GetSize() (w, h int) {
w, h, err := terminal.GetSize(int(os.Stdout.Fd()))
if err != nil {
w, h = 80, 25
}
return w, h
}
// Out is an io.Writer which can be used to write to the terminal
// eg for use with fmt.Fprintf(terminal.Out, "terminal fun: %d\n", n)
var Out io.Writer