github.com/xzl8028/xenia-server@v0.0.0-20190809101854-18450a97da63/cmd/platform/main.go (about) 1 // Copyright (c) 2015-present Xenia, 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/xzl8028/xenia-server/utils/fileutils" 12 ) 13 14 func main() { 15 // Print angry message to use xenia command directly 16 fmt.Println(` 17 ------------------------------------ ERROR ------------------------------------------------ 18 The platform binary has been deprecated, please switch to using the new xenia 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] = "xenia" 26 args = append(args, "--platform") 27 28 realXenia := fileutils.FindFile("xenia") 29 if realXenia == "" { 30 realXenia = fileutils.FindFile("bin/xenia") 31 } 32 33 if realXenia == "" { 34 fmt.Println("Could not start Xenia, use the xenia command directly: failed to find xenia") 35 } else if err := syscall.Exec(realXenia, args, nil); err != nil { 36 fmt.Printf("Could not start Xenia, use the xenia command directly: %s\n", err.Error()) 37 } 38 }