feat: add SERVER_BINARY, SERVER_PARAMS, STEAMCMD_PATH env vars
- ProcessManager.Start() reads SERVER_BINARY and SERVER_PARAMS from env with platform-based defaults as fallback - SteamCmdManager.run() reads STEAMCMD_PATH from env, defaults to 'steamcmd' - Makefile: add SERVER_BINARY/SERVER_PARAMS/STEAMCMD_PATH variables, copy stubs to dev-deploy in 'make dev', pass env vars to backend - .gitignore: add bin/
This commit is contained in:
@@ -85,9 +85,16 @@ func (pm *ProcessManager) Start() error {
|
||||
return fmt.Errorf("save was_running: %w", err)
|
||||
}
|
||||
|
||||
binName := "arma3server_x64"
|
||||
if s.Platform == "windows" {
|
||||
binName = "arma3server_x64.exe"
|
||||
if env := os.Getenv("SERVER_PARAMS"); env != "" {
|
||||
s.ServerParameters = env
|
||||
}
|
||||
|
||||
binName := os.Getenv("SERVER_BINARY")
|
||||
if binName == "" {
|
||||
binName = "arma3server_x64"
|
||||
if s.Platform == "windows" {
|
||||
binName = "arma3server_x64.exe"
|
||||
}
|
||||
}
|
||||
binPath := filepath.Join(pm.serverfileDir, binName)
|
||||
|
||||
|
||||
@@ -90,7 +90,11 @@ func (s *SteamCmdManager) run(label string, args []string) error {
|
||||
|
||||
s.streamer.Broadcast("steamcmd", "[STEAMCMD] "+label+" starting...")
|
||||
|
||||
cmd := exec.CommandContext(ctx, "steamcmd", args...)
|
||||
steamcmdPath := os.Getenv("STEAMCMD_PATH")
|
||||
if steamcmdPath == "" {
|
||||
steamcmdPath = "steamcmd"
|
||||
}
|
||||
cmd := exec.CommandContext(ctx, steamcmdPath, args...)
|
||||
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user