mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 19:45:28 +00:00
* use parsed options while signing * update project layout to v3 * fix .gitignore * remove example template * misc updates * bump tlsx version * hide template sig warning with env * js: retain value while using log * fix nil pointer derefernce * misc doc update --------- Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
30 lines
631 B
Go
30 lines
631 B
Go
package generators
|
|
|
|
import (
|
|
"os"
|
|
|
|
stringsutil "github.com/projectdiscovery/utils/strings"
|
|
)
|
|
|
|
var envVars map[string]interface{}
|
|
|
|
func parseEnvVars() map[string]interface{} {
|
|
sliceEnvVars := os.Environ()
|
|
parsedEnvVars := make(map[string]interface{}, len(sliceEnvVars))
|
|
for _, envVar := range sliceEnvVars {
|
|
key, _ := stringsutil.Before(envVar, "=")
|
|
val, _ := stringsutil.After(envVar, "=")
|
|
parsedEnvVars[key] = val
|
|
}
|
|
return parsedEnvVars
|
|
}
|
|
|
|
// EnvVars returns a map with all environment variables into a map
|
|
func EnvVars() map[string]interface{} {
|
|
if envVars == nil {
|
|
envVars = parseEnvVars()
|
|
}
|
|
|
|
return envVars
|
|
}
|