assaf / node-passbook

iOS Passbook for the Node hacker
MIT License
281 stars 73 forks source link

Removed bracket in regex to fixed empty signature issue #70

Closed vodaben closed 5 years ago

vodaben commented 5 years ago

The regular expression is capturing '\r\n' and '\n\n'. Therefore 3 more captured line breaks are in the result array of stdout.split(/(\r\n\r\n|\n\n)/) and the signature appears in position 6 instead of 3.

I am having success by removing the bracket in the regular expression. var signature = stdout.split(/\r\n|\n\n/)[3];