Skip to content

Commit

Permalink
Added server commands support
Browse files Browse the repository at this point in the history
  • Loading branch information
roblaszczak committed Jan 16, 2022
1 parent 332ce71 commit 132479b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 45 deletions.
1 change: 1 addition & 0 deletions trainings/api/protobuf/server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ message VerifyExerciseResponse {
bool finished = 1;
bool successful = 2;

string command = 8;
string stdout = 3;
string stderr = 4;

Expand Down
96 changes: 52 additions & 44 deletions trainings/genproto/server.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion trainings/genproto/server_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions trainings/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ func (h *Handlers) runExercise(ctx context.Context, trainingRootFs afero.Fs) (bo
Debug("Verification started")
}

if len(response.Command) > 0 {
fmt.Print(color.CyanString(fmt.Sprintf("𑗘 %s ➜ ", "/")) + response.Command)
}
if len(response.Stdout) > 0 {
fmt.Print(response.Stdout)
}
Expand Down

0 comments on commit 132479b

Please sign in to comment.