Documentation
¶
Index ¶
- Variables
- func CGGenEvents(outputDir, url, cgeVersion, language string) error
- func CheckVersion()
- func CompatibleVersion(versions map[string]string, version string) string
- func Execute(hidden bool, programName string, args ...string) (string, error)
- func ExecuteModule(name, libraryVersion, projectType string, args ...string) error
- func GetCGEVersion(baseURL string) (string, error)
- func GetEventNames(url, cgeVersion string) ([]string, error)
- func GetUsername() string
- func GithubTagFromVersion(owner, repo, version string) (string, error)
- func HasContentType(h http.Header, mimetype string) bool
- func IsInstalled(programName string) bool
- func LatestCGEVersion() (string, error)
- func LatestGithubTag(owner, repo string) (string, error)
- func LibraryVersionFromCGVersion(owner, repo, cgVersion string) string
- func LoadVersionsJSON(owner, repo string) (io.ReadCloser, error)
- func OpenBrowser(url string) error
- func ParseVersion(version string) (int, int, int, error)
- func UntargzFile(source io.Reader, fileName, outputFileName string) error
- func UnzipFile(source io.Reader, fileName, outputFileName string) error
Constants ¶
This section is empty.
Variables ¶
var ErrTagNotFound = errors.New("tag not found")
Functions ¶
func CGGenEvents ¶
CGGenEvents downloads the correct cg-gen-events version for the specified CGE version and executes it.
func CheckVersion ¶
func CheckVersion()
CheckVersion prints a warning, if there is a newer version of codegame-cli available.
func CompatibleVersion ¶
CompatibleVersion returns the next best compatible version in the versions map.
func Execute ¶
Execute the program with args. If hidden is set, no output (except errors) will be printed and stdout will not be passed to the program. It returns the combined output if hidden is true. Otherwise all output will be printed directly to stdout.
func ExecuteModule ¶
func GetCGEVersion ¶
GetCGEVersion returns the CGE version of the game server in the format 'x.y'.
func GetEventNames ¶
GetEventNames uses CGGenEvents() to get a list of all the available events of the game server at url. It only works for CGE versions >= 0.3
func GetUsername ¶
func GetUsername() string
GetUsername tries to determine the name of the current user. It looks at the following things in order:
- git config user.name
- currently logged in user of the OS
- returns <your-name> with a note to change it
func GithubTagFromVersion ¶
func HasContentType ¶
HasContentType returns true if the 'content-type' header includes mimetype.
func IsInstalled ¶
func LatestCGEVersion ¶
LatestCGEVersion returns the latest CGE version in the format 'x.y'.
func LatestGithubTag ¶
func LoadVersionsJSON ¶ added in v0.5.1
func LoadVersionsJSON(owner, repo string) (io.ReadCloser, error)
func OpenBrowser ¶
Opens the specified URL in the default browser.
func UntargzFile ¶
UntargzFile first decompresses source with gzip, then extracts the file with fileName into outputFileName.
Types ¶
This section is empty.