Hey, folks. Is there any way to prevent `box` from...
# box-products
l
Hey, folks. Is there any way to prevent
box
from checking for updates at startup time? I’m trying to use it in a (weird) automation scenario and the update check is screwing things up.
I think this will do it:
box_config_offlineMode=true box
b
@Leon Miller-Out Don't use that, there's another setting just for that
Also, the update checks only fire when the shell starts in interactive mode
So if you're executing a one-off command like
Copy code
box version
it shouldn't fire
l
I’m not doing a one-off in this case. What’s that other setting?
b
It's a module setting. Type
config set
and use tab complete to find it 🙂
l
b
There are three settings •
config set modules.commandbox-update-check.CLICheck
to disable the CLI version check •
config set modules.commandbox-update-check.systemModulesCheck
to disable the system modules check •
config set modules.commandbox-update-check.enable
to turn off the whole thing
l
To pass in
modules.commandbox-update-check.enable
as an env var, would I call it
box_config_modules.commandbox-update-check.enable
?
The dots seem to be illegal chars in the env var name.
b
Yes, except the fact that Linux doesn't allow dots in env var names because it sucks
If you were on Windows, that would work fine 🙂
l
Do you know of a workaround?
b
actually, it's not the dot-- you can turn those into underscores. It's the dash
While you can't change LInux's stupid rules, you can set the config setting other ways
Either run
Copy code
box config set modules.commandbox-update-check.enable=false
or directly edit the commandbox setting JSON file before running it
l
Cool. Thanks so much, Brad!
b
Or, you can just uninstall that module entirely. Just keep in mind, it will come back when you update box 🙂
l
OK. I think I am actually going to use
offlineMode
because it should not cause any problems for this specific use case.
b
👍
Oh, I just remembered another workaround-- just for completeness 🙂
I forgot about this trick
Copy code
box_config_modules={ "commandbox-update-check" : { "enable" : false } }
Set the env var at a level high enough there are no dashes in the name and convert the rest to JSON
The setting will be merged in so it's not an overwrite of the entire
modules
key
The same trick works from the CLI itself like so
Copy code
config set modules='{ "commandbox-update-check" : { "enable" : false } }' --append
l
Very tricky!
box_config_modules='{"commandbox-update-check":{"enable":false}}' box
seems to do the trick
👍 1
Arg. Couldn’t actually get it to work. I’m working in node and starting box with
childProcess.spawn
. I’m pretty sure I had the correct syntax, but ¯\_(ツ)_/¯
I’m punting and passing
box_config_offlineMode=true
when I start my automation script.
b
I blame node 😆
l
It’s definitely kind of weird to use node to orchestrate Java/CFML. I just found it very easy to do the networking stuff I needed to do by using Node stdlib stuff.
FYI, I’m running a
box
process in the background (for code formatting) and communicating with it over TCP.
I had problems with the polling of
cfformat watch
So now we do formatting as a git pre-commit hook.
b
@Leon Miller-Out You should chat with @Scott Steinbeck if you haven't already. He's been doing some work on this as well.
I worked with him a bit to help make the output of each command parsable