From 06548b43b4ecf380465200cbac1c3835d8be57a4 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Tue, 25 Dec 2018 19:44:45 +0000 Subject: [PATCH] Fixed line endings and player name usage --- README.md | 4 ---- ksmplayedsongs.nim | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c819a8e..509ae2f 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,6 @@ favourites folder containing all songs the player has ever played. nim c ksmplayedsongs.nim -## Download - -[Windows x64](https://neviyn.co.uk/release/ksmplayedsongs.exe) - ## License The MIT License (MIT) diff --git a/ksmplayedsongs.nim b/ksmplayedsongs.nim index 2cd333a..f3e0606 100644 --- a/ksmplayedsongs.nim +++ b/ksmplayedsongs.nim @@ -7,7 +7,7 @@ echo("If your ingame player name is not 'PLAYER' enter it now (otherwise press e playerName = readLine(stdin) if playerName == "": playerName = "PLAYER" -let userDir: string = mainDir & DirSep & "score" & DirSep & "PLAYER" +let userDir: string = mainDir & DirSep & "score" & DirSep & playerName let outFileName: string = mainDir & DirSep & "songs" & DirSep & "Played.fav" var f: File if open(f, outFileName, fmWrite): @@ -17,7 +17,10 @@ if open(f, outFileName, fmWrite): let fullPath = userDir & DirSep & path for k2, p2 in walkDir(fullPath, true): if k2 == pcDir: - f.writeLine(path & DirSep & p2) + f.write(path & "\\" & p2) + # KSM can only read Windows style line endings + f.write('\r') + f.write('\n') finally: close(f) else: