parseConfig parses the bytes of a devbox.json and returns a syntax tree.
(b []byte)
| 38 | |
| 39 | // parseConfig parses the bytes of a devbox.json and returns a syntax tree. |
| 40 | func parseConfig(b []byte) (*configAST, error) { |
| 41 | root, err := hujson.Parse(b) |
| 42 | if err != nil { |
| 43 | return nil, err |
| 44 | } |
| 45 | return &configAST{root: root}, nil |
| 46 | } |
| 47 | |
| 48 | // packagesField gets the "packages" field, initializing it if necessary. The |
| 49 | // member value will either be an array of strings or an object. When it's an |