Skip to content

Commit

Permalink
Make sure quotes in json are escaped
Browse files Browse the repository at this point in the history
I'm seeing issues when I run `eas build:list --json` because git commit messages are included in the result but git commit messages sometimes contain quotes. These aren't escaped and so I am seeing invalid json in the output that looks like this:

```
{
\\...
"gitCommitMessage": "Changed some "stuff""
}
```

I've changed this so that string values (only) are escaped using `JSON.stringify`.
  • Loading branch information
iainbeeston authored Feb 5, 2025
1 parent b3d0924 commit 1304f27
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/eas-cli/src/utils/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ function sanitizeValue(value: any): unknown {
}
});
return result;
} else if (value && typeof value === 'string') {
return JSON.stringify(value)
} else {
return value;
}
Expand Down

0 comments on commit 1304f27

Please sign in to comment.