Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/parseJob.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ var fs = require('fs'),

try {
fileContents = fs.readFileSync(path, 'utf-8');
// Strip trailing null bytes that can appear from filesystem-level padding
// (e.g. Bun runtime file writes on APFS). The PEG parser rejects \0 characters.
fileContents = fileContents.replace(/\0+$/, '');
obj = parser.parse(fileContents);
process.send(obj);
} catch (e) {
Expand Down
4 changes: 4 additions & 0 deletions lib/pbxProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ pbxProject.prototype.parse = function(cb) {
pbxProject.prototype.parseSync = function() {
var file_contents = fs.readFileSync(this.filepath, 'utf-8');

// Strip trailing null bytes that can appear from filesystem-level padding
// (e.g. Bun runtime file writes on APFS). The PEG parser rejects \0 characters.
file_contents = file_contents.replace(/\0+$/, '');

this.hash = parser.parse(file_contents);
return this;
}
Expand Down