6

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.

Community
  • 1
  • 1
Charlie Kay
  • 85
  • 1
  • 6

1 Answers1

2

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.

tehp
  • 5,018
  • 1
  • 24
  • 31
  • Hey, I feel this is a step closer. However it is still creating a folder called "1" outside the source files in the .zip which again breaks the structure of the resource pack. Also, this means Ill need to re-copy and paste the link of the release every time? Any further recommendations ? Thanks! – Charlie Kay Nov 27 '16 at 23:26
  • Oh, I misunderstood your question. I am going to edit my answer. – tehp Nov 27 '16 at 23:33
  • Okay, no problem. Hopefully you are still able to help :P – Charlie Kay Nov 27 '16 at 23:39
  • @CharlieKay let me know if it doesn't work for you :) – tehp Nov 27 '16 at 23:41
  • Your edited solution works perfectly. Am I correct in thinking that as long as I keep the name of the .zip file I upload ("PocketPixels_RPG") the same everytime I push a new .zip, the link: https://github.com/kayc01/PocketPixels_RPG/blob/master/PocketPixels_RPG.zip?raw=true Will always work? When its a case of replacing the .zip and it always being there – Charlie Kay Nov 27 '16 at 23:57
  • You are correct. Of course it is up to you, but what I would do is keep a "current" version of the zip in the repo called "PocketPixels_RPG", as well as backup versions named 0.1, 02 etc. Each time you release a new version, add the backup version file, for example 0.3, as well as a version which is named "PocketPixels_RPG". That way you will always have the backup zips of previous versions, and a current zip which will always have the same download link. – tehp Nov 28 '16 at 00:01