Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download Github .zip without Repository's name folder

I have made a Minecraft Resource Pack for a server. I want to make it so I can push the textures and modified files to the repository without changing the download link every time.

So, I came to GitHub to achieve such thing. Got all of it setup however... When clicking "Clone or Download" and clicking ZIP. The ZIP file contains a folder of the Project Name and Branch "PocketPixels_RPG-master".

This is breaking the structure of the folder and preventing the .ZIP to be read as a texture pack in Minecraft.

I saw one post (Zipping without creating parent folder) however I cannot do any commands when this needs to be downloaded by the server in server.properties with a direct download link (https://github.com/kayc01/PocketPixels_RPG/archive/master.zip) which can't be modified the same way when the minecraft server downloads it automatically.

So, does anyone have any alternate suggestions? Any file I can add to the GitHub to prevent the outer folder being created and to just contain the folders and files in the root of the branch? And if there is nothing that can be done about it, is there anything similar that would work the way I want it?

Thanks a lot! Any suggestions wanted.

-Note, I am fairly new to GitHub so try be as detailed and instructive as you can.

like image 939
Charlie Kay Avatar asked Oct 29 '22 16:10

Charlie Kay


1 Answers

Use releases!

https://help.github.com/articles/creating-releases/

You can use releases to do what you are trying to do and have the filename whatever you want.

The "tag version" field will become the file name.

Tag Version

For example, if you fill the tag version field with "1", the file will be called 1.zip

Hopefully this helps for your case!


Edit:

If you want to allow users to download a zip from GitHub with a specific filename, the only way that I know of to do this is:

Upload/push a pre compressed .zip file to GitHub like this: https://github.com/tehp/zipDownloadExample/blob/master/Factorial.class.zip

You can download the zip by hitting "View Raw", or by providing users a link like this one: https://github.com/tehp/zipDownloadExample/raw/master/Factorial.class.zip

You can find this link by right clicking the download button and selecting "copy link"

In my opinion, providing the direct link to the zip download is the best solution for non technical users.

like image 175
tehp Avatar answered Nov 09 '22 07:11

tehp