sigpwny / ctfd2pages

A tool to easily archive CTFd sites to GitHub Pages
Apache License 2.0
30 stars 5 forks source link

lib.sh: Fix stage 4 failing on user-mode CTFd instances #5

Closed sudoBash418 closed 1 year ago

sudoBash418 commented 1 year ago

On user-mode CTFd instances, the glob for team pages in 04_fix_pagination/stage.sh doesn't match any files and thus doesn't expand, causing git mv to fail on a non-existent file.
The same issue is present with the sed glob later in the script.

Enabling nullglob fixes this by having the glob expand to a null string when no files match.

zhuyifei1999 commented 1 year ago

LGTM. Does anything else break?

sudoBash418 commented 1 year ago

Nope, with this change it worked perfectly! (I made some minor tweaks because I'm not using Github Pages, but I don't think they should matter)

zhuyifei1999 commented 1 year ago

Ok, I'll merge this PR once I figure out some permission errors. I somehow lost write access to the entire org /shrug.