Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
add revision number to zip
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Aug 30, 2021
1 parent 340d80b commit 983df1a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apiclient/bundles.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,17 @@ func FetchBundle(entityType string, folder string, name string, revision string)
u.RawQuery = q.Encode()
u.Path = path.Join(u.Path, GetApigeeOrg(), entityType, name, "revisions", revision)

err := DownloadResource(u.String(), name, ".zip")
proxyName := name + "_" + revision

err := DownloadResource(u.String(), proxyName, ".zip")
if err != nil {
clilog.Error.Fatalf("error with entity: %s", name)
clilog.Error.Println(err)
return err
}

if len(folder) > 0 {
_ = os.Rename(name+".zip", path.Join(folder, name+".zip"))
_ = os.Rename(proxyName+".zip", path.Join(folder, proxyName+".zip"))
}

return nil
Expand Down

0 comments on commit 983df1a

Please sign in to comment.