feat: allow replacing buildpack list atomically

Add buildpacks:set --replace so callers can replace an app's complete ordered buildpack list in one command while preserving existing single-buildpack and --index behavior.

Closes #8802
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-07-07 18:37:38 -04:00
1 parent 25b1356435
commit 16f8b25bda
6 files changed
+205 -4

No files matched your search

@@ -66,10 +66,11 @@ func main() {
case "set":
args := flag.NewFlagSet("buildpacks:set", flag.ExitOnError)
index := args.Int("index", 0, "--index: the 1-based index of the URL in the list of URLs")
replace := args.Bool("replace", false, "--replace: replace the entire ordered buildpack list")
args.Parse(os.Args[2:])
appName := args.Arg(0)
buildpack := args.Arg(1)
err = buildpacks.CommandSet(appName, buildpack, *index)
_, buildpackList := common.ShiftString(args.Args())
err = buildpacks.CommandSet(appName, buildpackList, *index, *replace)
case "set-property":
args := flag.NewFlagSet("buildpacks:set-property", flag.ExitOnError)
global := args.Bool("global", false, "--global: set a global property")