MCPcopy Create free account
hub / github.com/SwishHQ/spread / processHermesBundle

Function processHermesBundle

cli/bundle_cli.go:252–294  ·  view source on GitHub ↗
(config BundleConfig)

Source from the content-addressed store, hash-verified

250}
251
252func processHermesBundle(config BundleConfig) error {
253 sysType := runtime.GOOS
254 exc := "/osx-bin/hermesc"
255 if sysType == "linux" {
256 exc = "/linux64-bin/hermesc"
257 }
258 if sysType == "windows" {
259 exc = "/win64-bin/hermesc.exe"
260 }
261 hbcUrl := config.ProjectDir + "build/CodePush/" + "main.jsbundle" + ".hbc"
262 cmd := exec.Command(
263 config.ProjectDir+"node_modules/react-native/sdks/hermesc"+exc,
264 "-emit-binary",
265 "-out",
266 hbcUrl,
267 config.ProjectDir+"build/CodePush/"+"main.jsbundle",
268 // "-output-source-map",
269 )
270
271 cmd.Dir = config.ProjectDir
272 out, err := cmd.CombinedOutput()
273 if err != nil {
274 fmt.Printf("combined out:\n%s\n", string(out))
275 log.Panic("cmd.Run() failed with ", err)
276 }
277 err = os.Remove(config.ProjectDir + "build/CodePush/" + "main.jsbundle")
278 if err != nil {
279 panic(err.Error())
280 }
281 data, err := os.ReadFile(hbcUrl)
282 if err != nil {
283 panic(err.Error())
284 }
285 err = os.WriteFile(config.ProjectDir+"build/CodePush/"+"main.jsbundle", data, 0755)
286 if err != nil {
287 panic(err.Error())
288 }
289 err = os.Remove(hbcUrl)
290 if err != nil {
291 panic(err.Error())
292 }
293 return nil
294}
295
296func createAndUploadBundle(config BundleConfig, fileName string, hash string) error {
297 log.Println("✦ Zipping bundle"+" "+config.AppName+" "+config.TargetVersion, fileName)

Callers 1

PushBundleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected