readExpoScheme reads the "expo.scheme" field from app.json in the working directory. Returns the raw string value, or empty if the framework is not expo or the file is missing.
(framework string)
| 1101 | // readExpoScheme reads the "expo.scheme" field from app.json in the working directory. |
| 1102 | // Returns the raw string value, or empty if the framework is not expo or the file is missing. |
| 1103 | func readExpoScheme(framework string) string { |
| 1104 | if framework != "expo" { |
| 1105 | return "" |
| 1106 | } |
| 1107 | cwd, err := os.Getwd() |
| 1108 | if err != nil { |
| 1109 | return "" |
| 1110 | } |
| 1111 | data, err := os.ReadFile(filepath.Join(cwd, "app.json")) |
| 1112 | if err != nil { |
| 1113 | return "" |
| 1114 | } |
| 1115 | var obj struct { |
| 1116 | Expo struct { |
| 1117 | Scheme string `json:"scheme"` |
| 1118 | } `json:"expo"` |
| 1119 | } |
| 1120 | if err := json.Unmarshal(data, &obj); err != nil { |
| 1121 | return "" |
| 1122 | } |
| 1123 | return obj.Expo.Scheme |
| 1124 | } |
| 1125 | |
| 1126 | // resolveNativeBundleID determines the bundle/package ID for native frameworks. |
| 1127 | func resolveNativeBundleID(inputs SetupInputs) string { |
no outgoing calls
no test coverage detected