Skip to content

Commit

Permalink
Support metadata file with Windows new lines
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
raulsntos committed Aug 23, 2022
1 parent 0f273c2 commit a82adf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/godot-tools-messaging/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a82adf7

Please sign in to comment.