mirror of
https://gitlab.com/xonotic/xonotic
synced 2025-02-09 06:56:51 +00:00
now the script can "download" the maps, and also "download-latest" from the "latest" subdir
This commit is contained in:
parent
da509672ee
commit
2cb95ff3d7
@ -42,10 +42,11 @@ buildthemap()
|
|||||||
getthemap()
|
getthemap()
|
||||||
{
|
{
|
||||||
url=$1
|
url=$1
|
||||||
bspdir=$2
|
bspdir_old=$2
|
||||||
M=$3
|
bspdir=$3
|
||||||
blobhash=$4
|
M=$4
|
||||||
if [ -f "$bspdir/$M-$blobhash.pk3" ]; then
|
blobhash=$5
|
||||||
|
if mv "$bspdir_old/$M-$blobhash.pk3" "$bspdir/$M-blobhash.pk3"; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
|
if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
|
||||||
@ -74,8 +75,18 @@ case "$1" in
|
|||||||
git checkout master
|
git checkout master
|
||||||
;;
|
;;
|
||||||
download)
|
download)
|
||||||
|
rm -rf "$bspdir.old"
|
||||||
|
mv "$bspdir" "$bspdir.old" || true
|
||||||
mkdir -p "$bspdir"
|
mkdir -p "$bspdir"
|
||||||
cd data/xonotic-maps.pk3dir
|
cd data/xonotic-maps.pk3dir
|
||||||
allmaps getthemap "$url" "$bspdir"
|
allmaps getthemap "$url" "$bspdir.old" "$bspdir"
|
||||||
|
echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"
|
||||||
|
ls -l "$bspdir.old"
|
||||||
|
;;
|
||||||
|
download-latest)
|
||||||
|
mkdir -p "$bspdir"
|
||||||
|
cd "$bspdir"
|
||||||
|
rm -f *-????????????????????????????????????????-????????????????????????????????????????.pk3
|
||||||
|
wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url/latest"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user