refactor: simplify env var passing by using a new config:export format

Also add a test for env vars during build time for pack-built applications.
This commit is contained in:
Jose Diaz-Gonzalez
2022-01-15 08:34:02 -05:00
parent 7f213beefa
commit 6f55b89149
6 changed files with 32 additions and 15 deletions

View File

@@ -13,14 +13,15 @@ func export(appName string, global bool, merged bool, format string) error {
suffix := "\n"
exportTypes := map[string]ExportFormat{
"exports": ExportFormatExports,
"envfile": ExportFormatEnvfile,
"docker-args": ExportFormatDockerArgs,
"docker-args-keys": ExportFormatDockerArgsKeys,
"shell": ExportFormatShell,
"pretty": ExportFormatPretty,
"envfile": ExportFormatEnvfile,
"exports": ExportFormatExports,
"json": ExportFormatJSON,
"json-list": ExportFormatJSONList,
"pack": ExportFormatPackArgKeys,
"pretty": ExportFormatPretty,
"shell": ExportFormatShell,
}
exportType, ok := exportTypes[format]