Fixed line endings and player name usage
This commit is contained in:
parent
b718dcaa3e
commit
06548b43b4
@ -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)
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user