some more changes for windows compatibility
This commit is contained in:
parent
b23c129b79
commit
e1160e3650
|
@ -218,4 +218,4 @@ Setting the `MM_DEBUG` environment variable will invoke the debug builds. The si
|
|||
* git push origin main
|
||||
* git push --tags
|
||||
|
||||
### last version commited v0.0.4
|
||||
### last version commited v0.1.0
|
Binary file not shown.
|
@ -4,9 +4,9 @@
|
|||
"description": "This plugin serves as a starting point for writing a Mattermost plugin.",
|
||||
"homepage_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate",
|
||||
"support_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate/issues",
|
||||
"release_notes_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdatereleases/tag/v0.0.4",
|
||||
"release_notes_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdatereleases/tag/v0.1.0",
|
||||
"icon_path": "assets/starter-template-icon.svg",
|
||||
"version": "0.0.4",
|
||||
"version": "0.1.0",
|
||||
"min_server_version": "6.2.1",
|
||||
"server": {
|
||||
"executables": {
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -18,9 +18,9 @@ const manifestStr = `
|
|||
"description": "This plugin serves as a starting point for writing a Mattermost plugin.",
|
||||
"homepage_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate",
|
||||
"support_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate/issues",
|
||||
"release_notes_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdatereleases/tag/v0.0.4",
|
||||
"release_notes_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdatereleases/tag/v0.1.0",
|
||||
"icon_path": "assets/starter-template-icon.svg",
|
||||
"version": "0.0.4",
|
||||
"version": "0.1.0",
|
||||
"min_server_version": "6.2.1",
|
||||
"server": {
|
||||
"executables": {
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
@ -36,16 +37,27 @@ var knownGames = map[string]bool{
|
|||
|
||||
// GetActiveGame scans processes to determine the active game based on known game names
|
||||
func (p *Plugin) GetActiveGame() (string, error) {
|
||||
// Use appropriate command for your OS
|
||||
cmd := exec.Command("ps", "-e")
|
||||
var cmd *exec.Cmd
|
||||
|
||||
// Check the operating system and execute the appropriate command
|
||||
if runtime.GOOS == "windows" {
|
||||
// For Windows, use tasklist command to get the list of processes
|
||||
cmd = exec.Command("tasklist")
|
||||
} else {
|
||||
// For Linux/macOS, use ps -e command to get the list of processes
|
||||
cmd = exec.Command("ps", "-e")
|
||||
}
|
||||
|
||||
output, err := cmd.Output()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// Convert output to a string and split into lines
|
||||
lines := strings.Split(string(output), "\n")
|
||||
for _, line := range lines {
|
||||
for gameName := range knownGames {
|
||||
// Check if the line contains a known game process
|
||||
if strings.Contains(line, gameName) {
|
||||
return gameName, nil
|
||||
}
|
||||
|
|
2
webapp/dist/main.js
vendored
2
webapp/dist/main.js
vendored
File diff suppressed because one or more lines are too long
|
@ -7,9 +7,9 @@ const manifest = JSON.parse(`
|
|||
"description": "This plugin serves as a starting point for writing a Mattermost plugin.",
|
||||
"homepage_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate",
|
||||
"support_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate/issues",
|
||||
"release_notes_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdatereleases/tag/v0.0.4",
|
||||
"release_notes_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdatereleases/tag/v0.1.0",
|
||||
"icon_path": "assets/starter-template-icon.svg",
|
||||
"version": "0.0.4",
|
||||
"version": "0.1.0",
|
||||
"min_server_version": "6.2.1",
|
||||
"server": {
|
||||
"executables": {
|
||||
|
|
Loading…
Reference in a new issue