mirror of
https://github.com/status-im/status-go.git
synced 2025-01-12 07:35:02 +00:00
e911666b5d
fixed make lint warnings cleared linter_exclude_list.txt removed some commented code fixed comments from #388
29 lines
462 B
Go
29 lines
462 B
Go
package process
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
|
|
"github.com/robertkrimen/otto"
|
|
)
|
|
|
|
// Define process
|
|
func Define(vm *otto.Otto, argv []string) error {
|
|
if v, err := vm.Get("process"); err != nil {
|
|
return err
|
|
} else if !v.IsUndefined() {
|
|
return nil
|
|
}
|
|
|
|
env := make(map[string]string)
|
|
for _, e := range os.Environ() {
|
|
a := strings.SplitN(e, "=", 2)
|
|
env[a[0]] = a[1]
|
|
}
|
|
|
|
return vm.Set("process", map[string]interface{}{
|
|
"env": env,
|
|
"argv": argv,
|
|
})
|
|
}
|