From a762fe780feea6748db21aefc6e606386721ba89 Mon Sep 17 00:00:00 2001 From: Pieds-Nus Date: Fri, 16 Sep 2022 21:11:15 +0000 Subject: [PATCH] factorimods : ctrl+c - ctrl+v fail. My bad. --- factorimods | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/factorimods b/factorimods index 4464114..5ad42f8 100644 --- a/factorimods +++ b/factorimods @@ -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