Script to zip your mod using info.json

Tools which are useful for mod development.
Post Reply
Pandemoneus
Fast Inserter
Fast Inserter
Posts: 127
Joined: Fri May 08, 2015 2:25 pm
Contact:

Script to zip your mod using info.json

Post by Pandemoneus »

I was tired of changing the folder name and zipping it to upload it to the Factorio mod portal after I had made changes to my mod, so I made a little python script:

https://github.com/Pandemoneus/ZipMod/b ... /ZipMod.py

Put it into your mod folder and run the script from there. (python ZipMod.py)
The script looks at your info.json, creates the necessary file structure for mods and then zips it.
You will find the zip-file in the same directory as the script.

Feel free to modify/adapt the script.
Last edited by Pandemoneus on Thu May 04, 2017 11:07 pm, edited 2 times in total.
My RSO+Bob's+Angel's modpack: Farlands (outdated)
Mods (current): Resource Labels
Mods (old): Biter Spires

User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 278
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Script to zip your mod

Post by Narc »

That's awesome! I had the same problem, but I fixed it with make.

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Script to zip your mod

Post by sparr »

Narc wrote:That's awesome! I had the same problem, but I fixed it with make.
Thanks for reminding me of this. Did you ever update it to handle the "new" (0.13?) requirements for info.json?

User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 278
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Script to zip your mod

Post by Narc »

sparr wrote:
Narc wrote:That's awesome! I had the same problem, but I fixed it with make.
Thanks for reminding me of this. Did you ever update it to handle the "new" (0.13?) requirements for info.json?
What's there to update? I just used the current Makefile to build EvoGUI v0.4.202, but it hasn't functionally changed since forever. I can't imagine what change might be needed.

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Script to zip your mod

Post by sparr »

I think I'm thinking of when they added factorio_version as mandatory in info.json?

User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 278
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Script to zip your mod

Post by Narc »

sparr wrote:I think I'm thinking of when they added factorio_version as mandatory in info.json?
The info.json is your own. All the makefile does is replace a few tags with things like the mod name or version.

Pandemoneus
Fast Inserter
Fast Inserter
Posts: 127
Joined: Fri May 08, 2015 2:25 pm
Contact:

Re: Script to zip your mod

Post by Pandemoneus »

Enhanced the script a bit to also include file pattern definitions from your .gitignore file, as per suggestion (https://github.com/Pandemoneus/Biter-Spire/issues/2)
My RSO+Bob's+Angel's modpack: Farlands (outdated)
Mods (current): Resource Labels
Mods (old): Biter Spires

Post Reply

Return to “Development tools”