Skip to content

Commit

Permalink
properly parse json5 strings
Browse files Browse the repository at this point in the history
  • Loading branch information
GantMan committed Aug 5, 2018
1 parent 4c1ece7 commit 1c0d353
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions checks/react-native.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
"output" : "verbose"
},
"requirements": {
"Node": [{ "rule": "cli", "binary": "node"}],
"Watchman": [
"Have Node": [{ "rule": "cli", "binary": "node"}],
"Have Watchman": [
{
"rule": "cli",
"binary": "watchman",
"error": "Please install watchman on this machine. Refer to the official Watchman installation instructions for additional help.",
"platform": ["darwin", "linux"]
}
],
"React Native": [
"Have React Native": [
{ "rule": "cli", "binary": "react-native" }
],
"Android": [
"Have Android": [
{
"rule": "env",
"variable": "ANDROID_HOME",
"error": "The ANDROID_HOME environment variable must be set to your local SDK. Refer to getting started docs for help."
}
],
"Xcode": [
"Have Xcode": [
{ "rule": "cli", "binary": "xcodebuild", "platform": "darwin" },
{ "rule": "cli", "binary": "xcrun", "platform": "darwin" }
]
Expand Down
5 changes: 4 additions & 1 deletion src/extensions/functions/getSolidaritySettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export const loadWebCheck = async (context, checkOption) => {
// console.log(result)
if (result.ok) {
checkSpinner.succeed(`Found ${checkOption}`)
const solidarityData = JSON5.parse(result.data)
// Convert strings to JSON5 objects
const solidarityData = (typeof result.data === 'string')
? JSON5.parse(result.data)
: result.data
return solidarityData
} else {
checkSpinner.fail(`Unable to find a known check stack for ${checkOption}`)
Expand Down

0 comments on commit 1c0d353

Please sign in to comment.