mirror of
https://github.com/status-im/re-natal.git
synced 2025-01-12 05:34:07 +00:00
add command set-figwheel-port
- used to set custom figwheel port in config.cljs - fixes #151
This commit is contained in:
parent
ce42e1bbd1
commit
5f6da94ae7
@ -901,6 +901,13 @@ autoRequire = (enabled, globally = false) ->
|
||||
else
|
||||
log "Auto-Require feature is disabled in use-figwheel command"
|
||||
|
||||
setFigwheelPort = (port, globally = false) ->
|
||||
configFile = if globally then '.re-natal' else '.re-natal.local'
|
||||
config = merge(readConfig(configFile, false), figwheelPort: port)
|
||||
writeConfig(config, configFile)
|
||||
log "Figwheel port is set to #{port}"
|
||||
log "Please run: re-natal use-figwheel to take effect."
|
||||
|
||||
cli._name = 're-natal'
|
||||
cli.version pkgJson.version
|
||||
|
||||
@ -989,6 +996,12 @@ cli.command 'enable-source-maps'
|
||||
.action () ->
|
||||
patchReactNativePackager()
|
||||
|
||||
cli.command 'set-figwheel-port <port>'
|
||||
.description 'configures the port of figwheel server (port 3449 is default)'
|
||||
.option '-g --global', 'use global .re-natal config instead of .re-natal.local'
|
||||
.action (port, cmd) ->
|
||||
setFigwheelPort(port, cmd.global)
|
||||
|
||||
cli.command 'enable-auto-require'
|
||||
.description 'enables source scanning for automatic required module resolution in use-figwheel command.'
|
||||
.option '-g --global', 'use global .re-natal config instead of .re-natal.local'
|
||||
|
@ -2,6 +2,6 @@
|
||||
|
||||
(def figwheel-urls {
|
||||
{{#each platforms}}
|
||||
:{{@key}} "ws://{{this.host}}:3449/figwheel-ws"
|
||||
:{{@key}} "ws://{{this.host}}:{{#if ../figwheelPort}}{{../figwheelPort}}{{else}}3449{{/if}}/figwheel-ws"
|
||||
{{/each}}
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user