add -g option to enable-auto-require and disable-auto-require
- by default these commands write to .re-natal.local - with -g or --global they will write to .re-natal file
This commit is contained in:
parent
e89aa2ddb3
commit
0f08f6c971
|
@ -878,10 +878,10 @@ inferComponents = () ->
|
||||||
|
|
||||||
writeConfig(config)
|
writeConfig(config)
|
||||||
|
|
||||||
autoRequire = (enabled) ->
|
autoRequire = (enabled, globally = false) ->
|
||||||
config = readAndVerifyConfig()
|
configFile = if globally then '.re-natal' else '.re-natal.local'
|
||||||
config.autoRequire = enabled
|
config = merge(readConfig(configFile, false), autoRequire: enabled)
|
||||||
writeConfig(config)
|
writeConfig(config, configFile)
|
||||||
if (enabled)
|
if (enabled)
|
||||||
log "Auto-Require feature is enabled in use-figwheel command"
|
log "Auto-Require feature is enabled in use-figwheel command"
|
||||||
else
|
else
|
||||||
|
@ -941,13 +941,13 @@ cli.command 'use-figwheel'
|
||||||
|
|
||||||
cli.command 'use-android-device <type>'
|
cli.command 'use-android-device <type>'
|
||||||
.description 'sets up the host for android device type: \'real\' - localhost, \'avd\' - 10.0.2.2, \'genymotion\' - 10.0.3.2, IP'
|
.description 'sets up the host for android device type: \'real\' - localhost, \'avd\' - 10.0.2.2, \'genymotion\' - 10.0.3.2, IP'
|
||||||
.option '-g --global', 'use global .re-natal config intead of .re-natal.local'
|
.option '-g --global', 'use global .re-natal config instead of .re-natal.local'
|
||||||
.action (type, cmd) ->
|
.action (type, cmd) ->
|
||||||
configureDevHostForAndroidDevice type, cmd.global
|
configureDevHostForAndroidDevice type, cmd.global
|
||||||
|
|
||||||
cli.command 'use-ios-device <type>'
|
cli.command 'use-ios-device <type>'
|
||||||
.description 'sets up the host for ios device type: \'simulator\' - localhost, \'real\' - auto detect IP on eth0, IP'
|
.description 'sets up the host for ios device type: \'simulator\' - localhost, \'real\' - auto detect IP on eth0, IP'
|
||||||
.option '-g --global', 'use global .re-natal config intead of .re-natal.local'
|
.option '-g --global', 'use global .re-natal config instead of .re-natal.local'
|
||||||
.action (type, cmd) ->
|
.action (type, cmd) ->
|
||||||
configureDevHostForIosDevice type, cmd.global
|
configureDevHostForIosDevice type, cmd.global
|
||||||
|
|
||||||
|
@ -978,13 +978,15 @@ cli.command 'enable-source-maps'
|
||||||
|
|
||||||
cli.command 'enable-auto-require'
|
cli.command 'enable-auto-require'
|
||||||
.description 'enables source scanning for automatic required module resolution in use-figwheel command.'
|
.description 'enables source scanning for automatic required module resolution in use-figwheel command.'
|
||||||
.action () ->
|
.option '-g --global', 'use global .re-natal config instead of .re-natal.local'
|
||||||
autoRequire(true)
|
.action (cmd) ->
|
||||||
|
autoRequire(true, cmd.global)
|
||||||
|
|
||||||
cli.command 'disable-auto-require'
|
cli.command 'disable-auto-require'
|
||||||
.description 'disables auto-require feature in use-figwheel command'
|
.description 'disables auto-require feature in use-figwheel command'
|
||||||
.action () ->
|
.option '-g --global', 'use global .re-natal config instead of .re-natal.local'
|
||||||
autoRequire(false)
|
.action (cmd) ->
|
||||||
|
autoRequire(false, cmd.global)
|
||||||
|
|
||||||
cli.command 'copy-figwheel-bridge'
|
cli.command 'copy-figwheel-bridge'
|
||||||
.description 'copy figwheel-bridge.js into project'
|
.description 'copy figwheel-bridge.js into project'
|
||||||
|
|
Loading…
Reference in New Issue