Full Mattermost server source with integrated Community Enterprise features. Includes vendor directory for offline/air-gapped builds. Structure: - enterprise-impl/: Enterprise feature implementations - enterprise-community/: Init files that register implementations - enterprise/: Bridge imports (community_imports.go) - vendor/: All dependencies for offline builds Build (online): go build ./cmd/mattermost Build (offline/air-gapped): go build -mod=vendor ./cmd/mattermost 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
39 lines
637 B
Go
39 lines
637 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package printer
|
|
|
|
import (
|
|
"bytes"
|
|
"errors"
|
|
"os"
|
|
|
|
"golang.org/x/term"
|
|
)
|
|
|
|
func checkInteractiveTerminal() error {
|
|
fileInfo, err := os.Stdout.Stat()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if (fileInfo.Mode() & os.ModeCharDevice) == 0 {
|
|
return errors.New("this is not an interactive shell")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func termHeight(file *os.File) (int, error) {
|
|
_, h, err := term.GetSize(int(file.Fd()))
|
|
if err != nil {
|
|
return -1, err
|
|
}
|
|
|
|
return h, nil
|
|
}
|
|
|
|
func lineCount(b []byte) int {
|
|
return bytes.Count(b, []byte{'\n'})
|
|
}
|