-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy pathinit-rn-cli.sh
More file actions
executable file
·41 lines (31 loc) · 2.02 KB
/
init-rn-cli.sh
File metadata and controls
executable file
·41 lines (31 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/expect -f
# Set infinite timeout to avoid script termination due to delays
set timeout -1
# Read command-line arguments
set notifier_version [lindex $argv 0]
set rn_version [lindex $argv 1]
set fixture_path [lindex $argv 2]
set MAZE_RUNNER_PORT $env(MAZE_RUNNER_PORT)
# Process React Native version string
set rn_version_cleaned [string map {".expo.ejected" "" "_" "."} [string range $rn_version 2 end]]
# Remove leading zeros if any
regsub -all {^0+} $rn_version_cleaned "" rn_version_cleaned
cd $fixture_path
# Start the Bugsnag React Native CLI initialization
spawn ./node_modules/.bin/bugsnag-react-native-cli init
# Handle CLI prompts
expect "Do you want to continue anyway?" { send -- "Y\r" }
expect "Are you using Bugsnag on-premise?" { send -- "Y\r" }
expect "What is your Bugsnag notify endpoint?" { send -- "http://bs-local.com:$MAZE_RUNNER_PORT/notify\r" }
expect "What is your Bugsnag sessions endpoint?" { send -- "http://bs-local.com:$MAZE_RUNNER_PORT/sessions\r" }
expect "What is your Bugsnag upload endpoint?" { send -- "http://localhost:$MAZE_RUNNER_PORT\r" }
expect "What is your Bugsnag build endpoint?" { send -- "http://localhost:$MAZE_RUNNER_PORT/builds\r" }
expect "If you want the latest version of @bugsnag/react-native hit enter, otherwise type the version you want" { send -- "$notifier_version\r" }
expect "What is your Bugsnag project API key?" { send -- "1234567890ABCDEF1234567890ABCDEF\r" }
expect "Do you want to install the BugSnag CLI to allow you to upload JavaScript source maps?" { send -- "Y\r" }
expect "If you want the latest version of @bugsnag/cli hit enter, otherwise type the version you want" { send -- "\r" }
expect "See https://docs.bugsnag.com/platforms/react-native/react-native/showing-full-stacktraces for details." { send -- "\r" }
expect "Do you want to update your Xcode build phase to output JavaScript source maps?" { send -- "Y\r" }
expect "This will enable you to see full native stacktraces. It can't be done automatically." { send -- "\r" }
# Ensure proper script termination
expect eof