mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
82 lines
1.5 KiB
Bash
Executable file
82 lines
1.5 KiB
Bash
Executable file
#!/bin/bash
|
|
#set -eux
|
|
|
|
#loadmode="forge"
|
|
loadmode=" "
|
|
|
|
rm -rf cardsets
|
|
|
|
if [ "$loadmode" == "forge" ]; then
|
|
cardsets_dir=PySolFC-Cardsets--Minimal-2.2.0
|
|
cardsets_file=${cardsets_dir}.tar.xz
|
|
|
|
echo '### prepare cardsets'
|
|
|
|
if [ ! -f ${cardsets_file} ]; then
|
|
echo '### downloading cardsets'
|
|
wget https://netix.dl.sourceforge.net/project/pysolfc/PySolFC-Cardsets/minimal/${cardsets_file}
|
|
fi
|
|
|
|
if [ ! -d ${cardsets_dir} ]; then
|
|
echo '### extracting cardsets'
|
|
tar -xf ${cardsets_file}
|
|
fi
|
|
|
|
echo '### processing cardsets'
|
|
(
|
|
cd ${cardsets_dir}
|
|
../../scripts/cardconv gif png
|
|
for i in cardset-*-png; do
|
|
rm -rf `basename $i -png`
|
|
done
|
|
)
|
|
|
|
ln -s ${cardsets_dir} cardsets
|
|
|
|
else
|
|
cardsets_dir=PySolFC-Cardsets
|
|
|
|
if [ ! -d ${cardsets_dir} ]; then
|
|
echo '### downloading cardset repo'
|
|
|
|
mkdir ${cardsets_dir}
|
|
pushd ${cardsets_dir}
|
|
|
|
mkdir repo
|
|
pushd repo
|
|
git init
|
|
git remote add -t master origin https://github.com/shlomif/PySolFC-Cardsets.git
|
|
git fetch --depth 1 origin 9b63a583dc3e770fa9bf8f2378c37a064aa4969c
|
|
git checkout -q FETCH_HEAD
|
|
popd
|
|
|
|
echo '### choose a minimal set'
|
|
|
|
for d in $(cat ../minimal.txt)
|
|
do
|
|
mv repo/${d} .
|
|
done
|
|
rm repo -rf
|
|
|
|
echo '### processing cardsets'
|
|
|
|
../../scripts/cardconv gif png
|
|
for i in cardset-*-png; do
|
|
rm -rf `basename $i -png`
|
|
done
|
|
popd
|
|
fi
|
|
# cp -a ${cardsets_dir} ${cardsets_dir}-orig
|
|
|
|
ln -s ${cardsets_dir} cardsets
|
|
fi
|
|
|
|
pushd cardsets
|
|
echo '### resize big cardsets'
|
|
|
|
for i in cardset-*; do
|
|
../resizecards $i
|
|
done
|
|
popd
|
|
|
|
echo '### end cardsets'
|