release_config: better default map paths
- Automatically determine the top of the workspace.
- build-flag defaults to using `get_build_var` to get product specific
release config maps.
- release-config defaults to using PRODUCT_RELEASE_CONFIG_MAPS but does
not use `get_build_var` unless the argument is given.
Bug: 328495189
Test: manual
Change-Id: I4ba3c5dfab43c4ebc3eeda13318f42e886dada4e
diff --git a/cmd/release_config/crunch_flags/main.go b/cmd/release_config/crunch_flags/main.go
index 5b64062..b67374a 100644
--- a/cmd/release_config/crunch_flags/main.go
+++ b/cmd/release_config/crunch_flags/main.go
@@ -311,8 +311,9 @@
var dirs rc_lib.StringList
var namespacesFile string
var descriptionsFile string
+ defaultTopDir, err := rc_lib.GetTopDir()
- flag.StringVar(&top, "top", ".", "path to top of workspace")
+ flag.StringVar(&top, "top", defaultTopDir, "path to top of workspace")
flag.Var(&dirs, "dir", "directory to process, relative to the top of the workspace")
flag.StringVar(&namespacesFile, "namespaces", "", "location of file with 'flag_name namespace' information")
flag.StringVar(&descriptionsFile, "descriptions", "", "location of file with 'directory description' information")