MCPcopy Create free account
hub / github.com/cloudfoundry/nodejs-buildpack / ListNodeConfig

Method ListNodeConfig

src/nodejs/supply/supply.go:497–518  ·  view source on GitHub ↗
(environment []string)

Source from the content-addressed store, hash-verified

495}
496
497func (s *Supplier) ListNodeConfig(environment []string) {
498 npmConfigProductionTrue := false
499 nodeEnv := "production"
500
501 for _, env := range environment {
502 if strings.HasPrefix(env, "NPM_CONFIG_") || strings.HasPrefix(env, "YARN_") || strings.HasPrefix(env, "NODE_") {
503 s.Log.Info(env)
504 }
505
506 if env == "NPM_CONFIG_PRODUCTION=true" {
507 npmConfigProductionTrue = true
508 }
509
510 if strings.HasPrefix(env, "NODE_ENV=") {
511 nodeEnv = env[9:]
512 }
513 }
514
515 if npmConfigProductionTrue && nodeEnv != "production" {
516 s.Log.Info("npm scripts will see NODE_ENV=production (not '%s')\nhttps://docs.npmjs.com/misc/config#production", nodeEnv)
517 }
518}
519
520func (s *Supplier) WarnUntrackedDependencies() error {
521 for _, command := range []string{"grunt", "bower", "gulp"} {

Callers 2

supply_test.goFile · 0.80
RunFunction · 0.80

Calls 1

InfoMethod · 0.80

Tested by

no test coverage detected