Make environment variables of the system accessible.

This commit is contained in:
Maximilian Paß
2021-11-17 10:16:51 +01:00
parent fbbc96da37
commit cf3db036fa
2 changed files with 2 additions and 2 deletions

View File

@ -278,7 +278,7 @@ paths:
type: string type: string
example: python exercise.py example: python exercise.py
environment: environment:
description: Environment variables for this execution. The keys of this object are the variable names and the value of each key is the value of the variable with the same name description: Environment variables for this execution. The keys of this object are the variable names and the value of each key is the value of the variable with the same name. The environment variables of the system remain accessible.
type: object type: object
additionalProperties: additionalProperties:
type: string type: string

View File

@ -24,7 +24,7 @@ type ExecutionRequest struct {
func (er *ExecutionRequest) FullCommand() []string { func (er *ExecutionRequest) FullCommand() []string {
command := make([]string, 0) command := make([]string, 0)
command = append(command, "env", "-") command = append(command, "env")
for variable, value := range er.Environment { for variable, value := range er.Environment {
command = append(command, fmt.Sprintf("%s=%s", variable, value)) command = append(command, fmt.Sprintf("%s=%s", variable, value))
} }