From a82adf7d08680bbe68e68de6ca948405781b7422 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Tue, 23 Aug 2022 10:44:45 +0200 Subject: [PATCH] Support metadata file with Windows new lines Replace Windows new lines (`\r\n`) with Unix new lines (`\n`) before splitting so we can handle the metadata file as if it was using `\n` all along. --- src/godot-tools-messaging/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/godot-tools-messaging/client.ts b/src/godot-tools-messaging/client.ts index 62e6f09..75786a4 100644 --- a/src/godot-tools-messaging/client.ts +++ b/src/godot-tools-messaging/client.ts @@ -372,7 +372,7 @@ export class Client implements Disposable { readMetadataFile(): GodotIdeMetadata | undefined { const buffer = fs.readFileSync(this.metaFilePath); const metaFileContent = buffer.toString('utf-8'); - const lines = metaFileContent.split('\n'); + const lines = metaFileContent.replace('\r\n', '\n').split('\n'); if (lines.length < 2) { return undefined;