Have .zip download file name be static (master.zip) without commit ID
Asked by Garrett Massey:

Currently, when downloading a bitbucket repository as a .zip, the file name is usually something like teamname-reponame-f74592.zip where the last bit is the most recent commit to the branch being downloaded.

Our usage requires that the name of the file be the same each time it is downloaded, as it automatically overrides the directory (in the WordPress Plugins folder). Is there a way to set the downloads to have a static name instead of the current name of the commit?


Answers:
author: Caroline R
body: Hi, [@Garrett Massey](/t5/user/viewprofilepage/user-id/4578715)! Welcome to the community!

Indeed, if you download the file, it will give you the commit number. However, you can choose the branch you would like to download and use the following command to specify the file name of your download:
>
> ```
> BRANCH='{master}'; WORKSPACE='{workspace_name}'; REPO='{repo_name}'; FOLDER='{new_folder}'; curl -u <username>:<password> https://bitbucket.org/$WORKSPACE/$REPO/get/$BRANCH.zip -s -o $REPO.zip && unzip -q $REPO.zip && find ./$WORKSPACE-$REPO-/ -exec mv {} $FOLDER/${f##/} ;
> ```

All you need to do is replace the **master** , **workspace_name** , **repo_name** , and **new_folder** with whatever you need.

This way, the zip file will be downloaded and it will have the repository name, and another folder will be created in your current working directory with the name you informed in "**new_folder**". This folder will contain all the content that is inside this zip file (in other words, it will unzip the file).

I hope this helps, but do let me know if you have any questions. Also, if you would like to open a feature request for that, I can definitely do this for you, just let me know :)

Kind regards,  
Caroline

comments: author: Garrett Massey
body: Thank you for your answer! Unfortunately, this solution isn't quite what we need for our process. We are using WordPress for our websites, and we can't currently specify the curl command like that for getting the zip for updates.

Our current workflow is that we check the master branch for any changes to a specific file, and then if that file has changed it prompts wordpress to notify for an update. Then the user clicks "Update plugin" and Wordpress fetches the zip from the URL as-is, so we can't use the \`-o\` option to specify the output file.

If you could open a feature request that would be fantastic. Something that would allow us to set the output in the BitBucket GUI for all downloads would be fantastic.


author: Caroline R
body: Hi, Garrett.

Thanks for getting back to us! In this case, I created the following feature request to implement this change:

* <https://jira.atlassian.com/browse/BCLOUD-21397>

I would suggest that you add your vote there (by selecting the **Vote for this issue** link) as the number of votes helps the development team and product managers better understand the demand for new features.

You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the **Start watching this issue** link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) and any updates will be posted in the feature request.

Please, feel free to share any additional questions regarding this subject.

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud