Browse Source

Update 'update-mods.sh'

master
Samuel Philipp 2 months ago
parent
commit
e9d69622b3
  1. 14
      update-mods.sh

14
update-mods.sh

@ -11,13 +11,15 @@ do
echo "downloading ${mod[0]}"
wget -q "${mod[1]}" -O temp.zip
echo "extracting ${mod[0]}"
unzip -oq temp.zip -d "$BASE/${mod[0]}"
FIRST=$(zipinfo -1 temp.zip | head -n 1)
if [[ "$FIRST" == */ ]]
then
cp -r "$BASE/${mod[0]}/$FIRST"* "$BASE/${mod[0]}/"
rm -r "$BASE/${mod[0]}/$FIRST"
unzip -oq temp.zip -d temp
rm -rf "$BASE/${mod[0]}/"
mkdir -p "$BASE/${mod[0]}/"
if [[ $(find temp/* -maxdepth 0 -type d | wc -l) == 1 ]]; then
cp -r temp/*/* "$BASE/${mod[0]}"
else
cp -r temp/* "$BASE/${mod[0]}"
fi
echo "cleanup"
rm -rf temp
rm temp.zip
done < mods.txt
Loading…
Cancel
Save