factorimods : ctrl+c - ctrl+v fail. My bad.

This commit is contained in:
Pieds-Nus 2022-09-16 21:11:15 +00:00
parent ee9cccb2e1
commit a762fe780f

View File

@ -19,11 +19,13 @@ cd $factorio_dir/saves
save=$(ls -t *.zip | grep -v autosave | rev | cut -d "." -f 2- | rev | dmenu -i -l 5 -p "Chose a save file: ")
test $? -ne 0 && echo "No save selected" && exit 1
echo $save
if test $1 = "-r" ; then
cp mod-list.json_$modlist mod-list.json_$save
if test "$1" = "-r" ; then
cp ../mods/mod-list.json mod-list.json_$save
modlist=$save
#Check if a modlist exists for that save
elif test -s mod-list.json_$save ; then
elif test -s "mod-list.json_$save" ; then
modlist=$save
else
#Otherwise, prompt to load another modlist
@ -35,6 +37,7 @@ else
echo -e "yes\nno" | dmenu -p "Save selected modlist for savegame $save ?" | grep -q "yes" && cp mod-list.json_$modlist mod-list.json_$save && modlist=$save
fi
echo $modlist
#Link that modlist to the file read by factorio
ln -fs ../saves/mod-list.json_$modlist ../mods/mod-list.json