build_flag: improve default flag value directory

The default directory for flag values is the last of:
 - Where the flag is declared,
 - Where the release config is first declared,
 - Where the flag value is currently being set for this release config.

Bug: 328495189
Test: manual
Change-Id: Ida1f906b75704f658e7fa1de703e0c789dce06a6
This commit is contained in:
LaMont Jones
2024-05-07 12:42:34 -07:00
parent 0d4a9ca792
commit d6406171ae
3 changed files with 28 additions and 2 deletions

View File

@@ -266,7 +266,7 @@ func SetCommand(configs *rc_lib.ReleaseConfigs, commonFlags Flags, cmd string, a
return fmt.Errorf("Unknown build flag %s", name)
}
if valueDir == "" {
mapDir, err := GetMapDir(*flagArtifact.Traces[len(flagArtifact.Traces)-1].Source)
mapDir, err := configs.GetFlagValueDirectory(release, flagArtifact)
if err != nil {
return err
}