Skip to content

Instantly share code, notes, and snippets.

@JohnTheCoolingFan
Last active January 27, 2023 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohnTheCoolingFan/eb0587b1156b137cb1cbf7111e82d14b to your computer and use it in GitHub Desktop.
Save JohnTheCoolingFan/eb0587b1156b137cb1cbf7111e82d14b to your computer and use it in GitHub Desktop.
A simple script that uses 7zip to build a Factorio mod and put it into the mods folder
#! /bin/bash
MODNAME="$(cat info.json | jq -r ".name")"
MODVERSION="$(cat info.json | jq -r ".version")"
mkdir -p "/tmp/buildmod/$MODNAME"_"$MODVERSION/"
cp -r * "/tmp/buildmod/$MODNAME"_"$MODVERSION/"
rm ~/.factorio/mods/"$MODNAME"*
7z a -sdel "/tmp/buildmod/$MODNAME"_"$MODVERSION.zip" "/tmp/buildmod/$MODNAME"_"$MODVERSION" > /dev/null
mv "/tmp/buildmod/$MODNAME"_"$MODVERSION.zip" ~/.factorio/mods/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment