-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmkzip.sh
executable file
·26 lines (22 loc) · 1016 Bytes
/
mkzip.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# Zips the contents of the mod to be uploaded with the name of the current folder
# NOTE! Factorio requires mods to have specific naming, thus the current folder
# (whose name is used) must be named appropriately: e.g., AircraftRealism_1.4.1
# Output is "currentFolderName.zip/currentFoldername/<contents>"
cd "$(dirname "$0")" || exit 1
foldername="$(basename "$PWD")"
filename="${foldername}.zip"
cd .. || exit 1 # Include the current directory (contains mod name) as part of zip
zip -r9 - \
"${foldername}/graphics/" \
"${foldername}/locale/" \
"${foldername}/logic/" \
"${foldername}/sound/" \
"${foldername}/api.lua" \
"${foldername}/control.lua" \
"${foldername}/data.lua" \
"${foldername}/settings.lua" \
"${foldername}/changelog.txt" \
"${foldername}/info.json" \
"${foldername}/thumbnail.png" \
> "${foldername}/${filename}"