alinmear / docker-conanexiles

A docker container to easily provision and manage a conanexiles dedicated server using wine
MIT License
105 stars 74 forks source link

Fixed mods.txt containing windows newline #49

Closed ElectroJo closed 3 years ago

ElectroJo commented 3 years ago

If mods.txt was manually created on windows or edited with a windows text editor, it may contain the windows newline \r\n instead of just the Unix newline \n. This will cause the generation of modlist.txt to fail as there will be an extra \r at the end of the folder name. That means the mod directory check will always return false:

[ -d /conanexiles/steamapps/workshop/content/$APPID_Mods/$modid ]

And changing to the mod directory always return that the directory is nonexistent:

cd /conanexiles/steamapps/workshop/content/$APPID_Mods/$modid

This fix strips the carriage return (\r) from the $modid string so that the string only contains the mod's ID.