github.com/isacikgoz/mattermost-server@v5.11.1+incompatible/cmd/platform/main.go (about)

     1  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
     2  // See LICENSE.txt for license information.
     3  
     4  package main
     5  
     6  import (
     7  	"fmt"
     8  	"os"
     9  	"syscall"
    10  
    11  	"github.com/mattermost/mattermost-server/utils/fileutils"
    12  )
    13  
    14  func main() {
    15  	// Print angry message to use mattermost command directly
    16  	fmt.Println(`
    17  ------------------------------------ ERROR ------------------------------------------------
    18  The platform binary has been deprecated, please switch to using the new mattermost binary.
    19  The platform binary will be removed in a future version.
    20  -------------------------------------------------------------------------------------------
    21  	`)
    22  
    23  	// Execve the real MM binary
    24  	args := os.Args
    25  	args[0] = "mattermost"
    26  	args = append(args, "--platform")
    27  
    28  	realMattermost := fileutils.FindFile("mattermost")
    29  	if realMattermost == "" {
    30  		realMattermost = fileutils.FindFile("bin/mattermost")
    31  	}
    32  
    33  	if realMattermost == "" {
    34  		fmt.Println("Could not start Mattermost, use the mattermost command directly: failed to find mattermost")
    35  	} else if err := syscall.Exec(realMattermost, args, nil); err != nil {
    36  		fmt.Printf("Could not start Mattermost, use the mattermost command directly: %s\n", err.Error())
    37  	}
    38  }