mirror of
https://github.com/status-im/re-natal.git
synced 2025-02-20 16:28:21 +00:00
provide feedback after use-ios-device command
This commit is contained in:
parent
df1c8fbd40
commit
14e5fa2bb8
@ -26,6 +26,7 @@ projNameUsRx = /\$PROJECT_NAME_UNDERSCORED\$/g
|
|||||||
interfaceDepsRx = /\$INTERFACE_DEPS\$/g
|
interfaceDepsRx = /\$INTERFACE_DEPS\$/g
|
||||||
platformRx = /\$PLATFORM\$/g
|
platformRx = /\$PLATFORM\$/g
|
||||||
devHostRx = /\$DEV_HOST\$/g
|
devHostRx = /\$DEV_HOST\$/g
|
||||||
|
ipAddressRx = /^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/i
|
||||||
figwheelUrlRx = /ws:\/\/[0-9a-zA-Z\.]*:/g
|
figwheelUrlRx = /ws:\/\/[0-9a-zA-Z\.]*:/g
|
||||||
appDelegateRx = /http:\/\/[^:]+/g
|
appDelegateRx = /http:\/\/[^:]+/g
|
||||||
rnVersion = '0.20.0'
|
rnVersion = '0.20.0'
|
||||||
@ -214,15 +215,24 @@ configureDevHostForAndroidDevice = (deviceType) ->
|
|||||||
catch {message}
|
catch {message}
|
||||||
logErr message
|
logErr message
|
||||||
|
|
||||||
configureDevHostForIosDevice = (deviceType) ->
|
resolveIosDevHost = (deviceType) ->
|
||||||
try
|
if deviceType == 'simulator'
|
||||||
devHost = if deviceType == 'simulator'
|
log "Using 'localhost' for iOS simulator"
|
||||||
'localhost'
|
'localhost'
|
||||||
else if deviceType == 'real'
|
else if deviceType == 'real'
|
||||||
exec('ipconfig getifaddr en0', true).toString().trim()
|
en0Ip = exec('ipconfig getifaddr en0', true).toString().trim()
|
||||||
|
log "Using IP of interface en0:'#{en0Ip}' for real iOS device"
|
||||||
|
en0Ip
|
||||||
|
else if deviceType.match(ipAddressRx)
|
||||||
|
log "Using development host IP: '#{deviceType}'"
|
||||||
|
deviceType
|
||||||
else
|
else
|
||||||
|
log("Value '#{deviceType}' is not a valid IP address, still configured it as development host for iOS", 'yellow')
|
||||||
deviceType
|
deviceType
|
||||||
|
|
||||||
|
configureDevHostForIosDevice = (deviceType) ->
|
||||||
|
try
|
||||||
|
devHost = resolveIosDevHost(deviceType)
|
||||||
config = readConfig()
|
config = readConfig()
|
||||||
config.iosHost = devHost
|
config.iosHost = devHost
|
||||||
writeConfig(config)
|
writeConfig(config)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user