4 Commits

Author SHA1 Message Date
Wilken Rivera
d597e93e70 improve error message 2020-09-25 12:12:31 -04:00
Wilken Rivera
1bb154de5a Add support for reading configs
This is the first step in attempting to read a Packer configuration file
via the packer init command. At the present moment it will try to read
one or more configuration templates from a given directory or path. Once
parsed it will error if parsing fails or exist successfully if it is
able to parse the file.

Looking at how the code is structured there will need to be changes made
to the following places:

- When no configuration file is found Packer will display an error. That
error should be bubbled up a bit so that the caller command can
determine if it should be displayed or not. For packer init no
configuration is not an error. Maybe it should be?

- After a configuration has been parsed there needs to be a single way
to determine a list of plugins associated with the configuration. HCL
and JSON configs have fields for this data but some is exported and some
is unexported. Adapting the packerHandler interface may be an option
here. More investigation needed.
2020-09-16 14:46:16 -04:00
Wilken Rivera
8069ae4f43 Add flagset to init command 2020-09-15 10:19:56 -04:00
Wilken Rivera
e8f7076416 Add simple init command 2020-09-14 16:33:51 -04:00