Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN apt-get update \
lib32stdc++6 \
lib32gcc1 \
wget \
rename \
ca-certificates \
&& \
apt-get remove --purge -y \
Expand Down
2 changes: 1 addition & 1 deletion launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def mod_param(name, mods):
return ' -{}="{}" '.format(name, ";".join(mods))
return ' -{}="{}" '.format(name, ";".join(mods)).replace('/arma3/', '')


def env_defined(key):
Expand Down
7 changes: 5 additions & 2 deletions workshop.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
WORKSHOP = "/arma3/steamapps/workshop/content/107410/"
USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36" # noqa: E501

def lowercase_workshop_dir(path: str):
os.system("(cd {} && find . -depth -exec rename -v 's/(.*)\/([^\/]*)/$1\/\L$2/' {{}} \;)".format(path))

def mod(id):
def download_mod(id):
steamcmd = ["/steamcmd/steamcmd.sh"]
steamcmd.extend(["+login", os.environ["STEAM_USER"], os.environ["STEAM_PASSWORD"]])
steamcmd.extend(["+force_install_dir", "/arma3"])
Expand All @@ -35,8 +37,9 @@ def preset(mod_file):
regex = r"filedetails\/\?id=(\d+)\""
matches = re.finditer(regex, html, re.MULTILINE)
for _, match in enumerate(matches, start=1):
mod(match.group(1))
download_mod(match.group(1))
moddir = WORKSHOP + match.group(1)
lowercase_workshop_dir(moddir)
mods.append(moddir)
keys.copy(moddir)
return mods