Skip to content

Commit fb940b4

Browse files
committed
minor fixes
1 parent 461e41d commit fb940b4

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

src/nodejs/hooks/sealights.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,9 @@ func (sl *SealightsHook) SetApplicationStartInPackageJson(stager *libbuildpack.S
367367
func (sl *SealightsHook) ReadPackageJson(stager *libbuildpack.Stager) (map[string]interface{}, error) {
368368
p := map[string]interface{}{}
369369

370-
if err := libbuildpack.NewJSON().Load(filepath.Join(stager.BuildDir(), "package.json"), &p); err != nil {
370+
if err := libbuildpack.NewJSON().Load(filepath.Join(stager.BuildDir(), PackageJsonFile), &p); err != nil {
371371
if err != nil {
372-
sl.Log.Error("failed to read %s error: %s", Procfile, err.Error())
372+
sl.Log.Error("failed to read %s error: %s", PackageJsonFile, err.Error())
373373
return nil, err
374374
}
375375
}
@@ -399,7 +399,7 @@ func (sl *SealightsHook) SetApplicationStartInManifest(stager *libbuildpack.Stag
399399
return sl.SetApplicationStartInPackageJson(stager, scriptName)
400400
}
401401

402-
// we suppose that format is "start: node <application>"
402+
// we suppose that format is "node <application>"
403403
var newCmd string
404404
newCmd, err = sl.updateStartCommand(originalStartCommand)
405405
if err != nil {
@@ -529,13 +529,13 @@ func (sl *SealightsHook) injectSealights(stager *libbuildpack.Stager) error {
529529
sl.Log.Info("Integrating sealights into manifest.yml")
530530
return sl.SetApplicationStartInManifest(stager)
531531
} else {
532-
sl.Log.Info("Integrating sealights into package.json")
533-
// Use configured script name or default to "start"
534-
scriptName := sl.parameters.NpmRunScript
535-
if scriptName == "" {
536-
scriptName = "start"
537-
}
538-
return sl.SetApplicationStartInPackageJson(stager, scriptName)
532+
sl.Log.Info("Integrating sealights into package.json")
533+
// Use configured script name or default to "start"
534+
scriptName := sl.parameters.NpmRunScript
535+
if scriptName == "" {
536+
scriptName = "start"
537+
}
538+
return sl.SetApplicationStartInPackageJson(stager, scriptName)
539539
}
540540
}
541541

@@ -584,7 +584,7 @@ func (sl *SealightsHook) parseVcapServices() {
584584
ProxyPassword: queryString("proxyPassword"),
585585
ProjectRoot: queryString("projectRoot"),
586586
TestStage: queryString("testStage"),
587-
NpmRunScript: queryString("npmRunScript"),
587+
NpmRunScript: queryString("npmRunScript"),
588588
}
589589

590590
// write warning in case token is not provided

0 commit comments

Comments
 (0)