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

Method ReadPackageJSON

src/nodejs/finalize/finalize.go:52–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50}
51
52func (f *Finalizer) ReadPackageJSON() error {
53 var p struct {
54 Scripts struct {
55 StartScript string `json:"start"`
56 } `json:"scripts"`
57 }
58
59 if err := libbuildpack.NewJSON().Load(filepath.Join(f.Stager.BuildDir(), "package.json"), &p); err != nil {
60 if os.IsNotExist(err) {
61 f.Log.Warning("No package.json found")
62 return nil
63 }
64
65 return err
66 }
67
68 f.StartScript = p.Scripts.StartScript
69
70 return nil
71}
72
73func (f *Finalizer) CopyProfileScripts() error {
74 profiledDir := filepath.Join(f.Stager.DepDir(), "profile.d")

Callers 2

finalize_test.goFile · 0.45
RunFunction · 0.45

Calls 1

BuildDirMethod · 0.65

Tested by

no test coverage detected