Quotes bullshit
authorCameron Ball <cameron@cameron1729.xyz>
Sun, 10 Mar 2019 08:04:31 +0000 (16:04 +0800)
committerCameron Ball <cameron@cameron1729.xyz>
Sun, 10 Mar 2019 08:05:36 +0000 (16:05 +0800)
ScoreSync.sh

index 8ed809a..7039362 100755 (executable)
@@ -30,14 +30,14 @@ if [ "$1" = "push" ]; then
             for d in "${difficulties[@]}"; do
                 for t in "${step_types[@]}"; do
                     xmlstarletcmd="$xmlstarletcmd -o \"NEWLIST:$person:$t:$d\" -n \
-                                 -v '//SongScores//Song[starts-with(@Dir, \"Songs/$persons_folder\")]//Steps[@Difficulty=\"$d\" and @StepsType=\"$t\"]//HighScore[1]//Name[text()=\"EVNT\" or text()=\"$me_highscore_name\"]/following-sibling::PercentDP' \
+                                 -v \"//SongScores//Song[starts-with(@Dir, \\\"Songs/$persons_folder\\\")]//Steps[@Difficulty=\\\"$d\\\" and @StepsType=\\\"$t\\\"]//HighScore[1]//Name[text()=\\\"EVNT\\\" or text()=\\\"$me_highscore_name\\\"]/following-sibling::PercentDP\" \
                                  -n -o \"SONGS\" -n \
-                                 -v '//SongScores//Song[starts-with(@Dir, \"Songs/$persons_folder\")]//Steps[@Difficulty=\"$d\" and @StepsType=\"$t\"]//HighScore[1]//Name[text()=\"EVNT\" or text()=\"$me_highscore_name\"]/ancestor::Song/@Dir'"
+                                 -v \"//SongScores//Song[starts-with(@Dir, \\\"Songs/$persons_folder\\\")]//Steps[@Difficulty=\\\"$d\\\" and @StepsType=\\\"$t\\\"]//HighScore[1]//Name[text()=\\\"EVNT\\\" or text()=\\\"$me_highscore_name\\\"]/ancestor::Song/@Dir\""
                 done
             done
         done < <(find "${DIR}"/*.favourites.txt -type f -print0)
 
-        scores_and_shit=$(eval "xmlstarlet sel -t $xmlstarletcmd -n -o \"NEWLIST\" ${path_to_stats}")
+        scores_and_shit=$(eval "xmlstarlet sel -t $xmlstarletcmd -n -o \"NEWLIST\" \"${path_to_stats}\"")
         IFS=$'\n' read -rd '' -a scores_list <<<"$scores_and_shit"
 
         echo "$me_highscore_name" > "${DIR}/$me.scores.txt"