@@ -46,15 +46,15 @@ func run() {
4646
4747 createClient ()
4848
49- // List all objects with <basePrefix>staging/ prefix
50- allObjects , err := listObjectsWithPrefix (basePrefix + "staging/" )
49+ // List all objects with staging/<basePrefix> prefix
50+ stagingPrefix := "staging/" + basePrefix
51+ allObjects , err := listObjectsWithPrefix (stagingPrefix )
5152 if err != nil {
5253 log .Fatalf ("Failed to list staging objects: %v" , err )
5354 }
5455
5556 // Filter out the root staging directory itself (but keep subdirectories)
5657 var stagingObjects []types.Object
57- stagingPrefix := basePrefix + "staging/"
5858 for _ , obj := range allObjects {
5959 if * obj .Key == stagingPrefix {
6060 continue
@@ -75,8 +75,8 @@ func run() {
7575 // Copy each staging object to production location and delete the staging version
7676 for _ , obj := range stagingObjects {
7777 stagingKey := * obj .Key
78- relativeKey := strings .TrimPrefix (stagingKey , basePrefix + "staging/" )
79- destinationKey := basePrefix + "release/" + relativeKey
78+ relativeKey := strings .TrimPrefix (stagingKey , stagingPrefix )
79+ destinationKey := basePrefix + relativeKey
8080
8181 fmt .Printf ("Promoting %s -> %s\n " , stagingKey , destinationKey )
8282
0 commit comments