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.
This commit is contained in:
Raul Santos
2022-08-23 10:44:45 +02:00
parent 0f273c273e
commit a82adf7d08

View File

@@ -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;