|
@@ -10,6 +10,7 @@ package entities
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
|
+ "os"
|
|
|
"strings"
|
|
"strings"
|
|
|
"sync"
|
|
"sync"
|
|
|
|
|
|
|
@@ -26,6 +27,7 @@ type variableBase struct {
|
|
|
|
|
|
|
|
CurrentEntity interface{}
|
|
CurrentEntity interface{}
|
|
|
Arguments map[string]string
|
|
Arguments map[string]string
|
|
|
|
|
+ Env map[string]string
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type installationInfo struct {
|
|
type installationInfo struct {
|
|
@@ -41,12 +43,21 @@ var (
|
|
|
func init() {
|
|
func init() {
|
|
|
rwmutex.Lock()
|
|
rwmutex.Lock()
|
|
|
|
|
|
|
|
|
|
+ envMap := make(map[string]string)
|
|
|
|
|
+ for _, env := range os.Environ() {
|
|
|
|
|
+ parts := strings.SplitN(env, "=", 2)
|
|
|
|
|
+ if len(parts) == 2 {
|
|
|
|
|
+ envMap[parts[0]] = parts[1]
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
contents = &variableBase{
|
|
contents = &variableBase{
|
|
|
OliveTin: installationInfo{
|
|
OliveTin: installationInfo{
|
|
|
Build: installationinfo.Build,
|
|
Build: installationinfo.Build,
|
|
|
Runtime: installationinfo.Runtime,
|
|
Runtime: installationinfo.Runtime,
|
|
|
},
|
|
},
|
|
|
Entities: make(entitiesByClass, 0),
|
|
Entities: make(entitiesByClass, 0),
|
|
|
|
|
+ Env: envMap,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
rwmutex.Unlock()
|
|
rwmutex.Unlock()
|