Jump to content

Mod Download URL using git repo

Recommended Posts

Sorry if this has already been brought up, it should have. Is it already possible to use a git url ( example://github.com/???????/????????/archive/master.zip) but on extract it will include "-master" in the folder path. Would be cool if it was just a feature + its ez to update mods via git.

I could literally store all my mods then on git so when i update git, its just a matter of pulling on tcadmin (id have a deploy script anyway automating the whole process) , which also could be a script.


Edited by MarkMozza
Link to comment
Share on other sites

Yes, you can just define it like this in the File URL: https://github.com/example/repo/archive/master.zip filename.zip

The last part will define what the file is going to be called after downloaded.

However, when extracting this archive, you will just get a folder that's called "reponame-master". You'd need to create a custom script to move files out from this folder. If you open the archive on your own PC, you will also see the same folder. It's not something TCAdmin creates.


Link to comment
Share on other sites

Yes i understand, this is fine for now i guess, but still would be 100x better if you could just provide the .git file and the system will clone it and update with a single button. Your expecting customers to be all experienced with code.


Link to comment
Share on other sites

That's just how it works. There's no way to have a "fit all" solution for this. When you download an archive from Github, it will always extract into "reponame-master". That's not something TCAdmin does. When you download from other places, it might be a second or third way - there's now way to make a function that will suit everything.

If you give a bit more info about what you need to download (and for what) and where it needs to go, I'll see if I can make a script for you ?


Link to comment
Share on other sites

Yeah i completely understand, makes perfect sense.

I guess because of the update period of most mods is daily, i wanted an easy way to link directly to the git, so each time the mod is installed its up to date.

If you could write something very basic that can do it, i should be able to figure out the rest, i am a developer myself but never done this kind of scripting, feel like a bit of a novice here. I was thinking about writing  a PHP download script that will clone and rezip and push the new zip to download.


Link to comment
Share on other sites

This is easy to script.


Put the master zip in the url, e.g. https://gitlab.com/KhaineGB/darknessfallsa18server/-/archive/master/darknessfallsa18server-master.zip

That downloads it and extracts it to darknessfallsa18server-master 

Add a move files script that runs after extracting mod files:

@echo off

cd "darknessfallsa18server-master"

xcopy /y /s  ".\*" "..\"

cd ..\

RD /S /Q "darknessfallsa18server-master"


Then it's done.



I don't normally share code, but this thread has been the most unhelpful thing ive ever seen.

Edited by mouseymars
Link to comment
Share on other sites

  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use