Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] mods_downloader.sh parse filename with line break #269

Open
erdoking opened this issue Aug 21, 2024 · 0 comments
Open

[BUG] mods_downloader.sh parse filename with line break #269

erdoking opened this issue Aug 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@erdoking
Copy link

erdoking commented Aug 21, 2024

Describe the bug
mods_downloader.sh parse filename with line break

To Reproduce
Steps to reproduce the behavior:
Set MODS_URLS="https://github.com/BlackRabbitMsk/projectz-free-modpack/archive/refs/heads/main.zip"

Versions:

  • vinanrra/7dtd-server latest (from this day)

Additional context


Aug 22 01:13:30 gameserver-7days docker-7DaysToDie[72036]: INFO: Download successful: projectz-free-modpack-main.zip
Aug 22 01:13:30 gameserver-7days docker-7DaysToDie[72036]: WARNING: Unsupported file type. No extraction performed.
Aug 22 01:13:30 gameserver-7days docker-7DaysToDie[72036]: ERROR: Modinfo.xml not found in the extracted files.
tmp/test$ bash -x mods_downloader.sh
+ MODS_FOLDER=/tmp/test
+ MODS_URLS=https://github.com/BlackRabbitMsk/projectz-free-modpack/archive/refs/heads/main.zip
+ mkdir -p /tmp/test
+ mkdir -p /tmp/test/tmp
++ echo https://github.com/BlackRabbitMsk/projectz-free-modpack/archive/refs/heads/main.zip
++ sed -e 's/^ *//;s/ *$//'
++ tr -d '"'
+ MODS_URLS=https://github.com/BlackRabbitMsk/projectz-free-modpack/archive/refs/heads/main.zip
+ IFS=', '
+ read -r -a urls
+ for url in "${urls[@]}"
++ curl -sIL https://github.com/BlackRabbitMsk/projectz-free-modpack/archive/refs/heads/main.zip
++ grep -i -o -E 'content-disposition:.*filename="?([^"]*)"?'
++ sed -E 's/.*filename="?([^"]*)"?/\1/'
**+ filename=$'projectz-free-modpack-main.zip\r'**
+ '[' -z $'projectz-free-modpack-main.zip\r' ']'
 from https://github.com/BlackRabbitMsk/projectz-free-modpack/archive/refs/heads/main.zip...'
 from https://github.com/BlackRabbitMsk/projectz-free-modpack/archive/refs/heads/main.zip...
+ curl https://github.com/BlackRabbitMsk/projectz-free-modpack/archive/refs/heads/main.zip -SsL -o $'projectz-free-modpack-main.zip\r'
+ '[' 0 -eq 0 ']'
' echo 'INFO: Download successful: projectz-free-modpack-main.zip
INFO: Download successful: projectz-free-modpack-main.zip
 == *.zip ]]z-free-modpack-main.zip
 == *.rar ]]z-free-modpack-main.zip
+ echo 'WARNING: Unsupported file type. No extraction performed.'
WARNING: Unsupported file type. No extraction performed.
++ find /tmp/test/tmp -type f -iname Modinfo.xml -exec dirname '{}' ';'
+ mod_folder=
++ basename ''
+ mod_folder_name=
+ '[' -n '' ']'
+ echo 'ERROR: Modinfo.xml not found in the extracted files.'
ERROR: Modinfo.xml not found in the extracted files.
 from https://github.com/BlackRabbitMsk/projectz-free-modpack/archive/refs/heads/main.zip'
 from https://github.com/BlackRabbitMsk/projectz-free-modpack/archive/refs/heads/main.zip
+ rm -rf $'/tmp/test/tmp/projectz-free-modpack-main.zip\r'
+ rm -rf /tmp/test/tmp
+ echo 'All downloads, extractions, and folder movements completed.'
All downloads, extractions, and folder movements completed.
@erdoking erdoking added the bug Something isn't working label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant