changed function to work with windows only for now

This commit is contained in:
root 2024-09-20 08:11:52 -07:00
parent e1160e3650
commit ae981ad60e
12 changed files with 10 additions and 19 deletions

View file

@ -4,9 +4,9 @@
"description": "This plugin serves as a starting point for writing a Mattermost plugin.", "description": "This plugin serves as a starting point for writing a Mattermost plugin.",
"homepage_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate", "homepage_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate",
"support_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate/issues", "support_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate/issues",
"release_notes_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdatereleases/tag/v0.1.0", "release_notes_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdatereleases/tag/v0.1.1",
"icon_path": "assets/starter-template-icon.svg", "icon_path": "assets/starter-template-icon.svg",
"version": "0.1.0", "version": "0.1.1",
"min_server_version": "6.2.1", "min_server_version": "6.2.1",
"server": { "server": {
"executables": { "executables": {

File diff suppressed because one or more lines are too long

View file

@ -18,9 +18,9 @@ const manifestStr = `
"description": "This plugin serves as a starting point for writing a Mattermost plugin.", "description": "This plugin serves as a starting point for writing a Mattermost plugin.",
"homepage_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate", "homepage_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate",
"support_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate/issues", "support_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate/issues",
"release_notes_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdatereleases/tag/v0.1.0", "release_notes_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdatereleases/tag/v0.1.1",
"icon_path": "assets/starter-template-icon.svg", "icon_path": "assets/starter-template-icon.svg",
"version": "0.1.0", "version": "0.1.1",
"min_server_version": "6.2.1", "min_server_version": "6.2.1",
"server": { "server": {
"executables": { "executables": {

View file

@ -4,7 +4,6 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"os/exec" "os/exec"
"runtime"
"strings" "strings"
"sync" "sync"
"time" "time"
@ -37,16 +36,8 @@ var knownGames = map[string]bool{
// GetActiveGame scans processes to determine the active game based on known game names // GetActiveGame scans processes to determine the active game based on known game names
func (p *Plugin) GetActiveGame() (string, error) { func (p *Plugin) GetActiveGame() (string, error) {
var cmd *exec.Cmd // For Windows, use tasklist command to get the list of processes
cmd := exec.Command("tasklist")
// 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() output, err := cmd.Output()
if err != nil { if err != nil {

2
webapp/dist/main.js vendored

File diff suppressed because one or more lines are too long

View file

@ -7,9 +7,9 @@ const manifest = JSON.parse(`
"description": "This plugin serves as a starting point for writing a Mattermost plugin.", "description": "This plugin serves as a starting point for writing a Mattermost plugin.",
"homepage_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate", "homepage_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate",
"support_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate/issues", "support_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdate/issues",
"release_notes_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdatereleases/tag/v0.1.0", "release_notes_url": "https://gitlab.peanutsmediaserver.com/aaron/gameStatusUpdatereleases/tag/v0.1.1",
"icon_path": "assets/starter-template-icon.svg", "icon_path": "assets/starter-template-icon.svg",
"version": "0.1.0", "version": "0.1.1",
"min_server_version": "6.2.1", "min_server_version": "6.2.1",
"server": { "server": {
"executables": { "executables": {