Skip to content

Commit 7f3bf3b

Browse files
committed
Implement run command
1 parent 4a91b16 commit 7f3bf3b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

run.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,25 @@ func Run() error {
3333
}
3434

3535
func runClient(url string, args []string) error {
36-
cmdArgs := []string{"run", "."}
36+
cmdArgs := []string{"run", "--"}
3737
cmdArgs = append(cmdArgs, args...)
3838

3939
env := []string{"CG_GAME_URL=" + url}
4040
env = append(env, os.Environ()...)
4141

42-
if _, err := exec.LookPath("go"); err != nil {
43-
return fmt.Errorf("'go' ist not installed!")
42+
if _, err := exec.LookPath("dotnet"); err != nil {
43+
return fmt.Errorf("'dotnet' ist not installed!")
4444
}
4545

46-
cmd := exec.Command("go", cmdArgs...)
46+
cmd := exec.Command("dotnet", cmdArgs...)
4747
cmd.Stdin = os.Stdin
4848
cmd.Stdout = os.Stdout
4949
cmd.Stderr = os.Stderr
5050
cmd.Env = env
5151

5252
err := cmd.Run()
5353
if err != nil {
54-
return fmt.Errorf("Failed to run 'CG_GAME_URL=%s go %s'", url, strings.Join(cmdArgs, " "))
54+
return fmt.Errorf("Failed to run 'CG_GAME_URL=%s dotnet %s'", url, strings.Join(cmdArgs, " "))
5555
}
5656
return nil
5757
}

templates/new/client/Events.cs.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public partial class Game : IDisposable
1313
/// Sends a `{{.Name}}` command.
1414
/// </summary>
1515
/// <param name="data">The command data.</param>
16+
/// <exception cref="InvalidOperationException">Thrown when socket is not connected to a player.</exception>
1617
/// <exception cref="System.Text.Json.JsonException">Thrown when the command could not be serialized.</exception>
1718
public void Send{{.PascalName}}({{.PascalName}}Cmd data)
1819
{

0 commit comments

Comments
 (0)