brew install --help doesn't say anything about this.
It’s documented in the manpage (man brew):
$ HOMEBREW_NO_AUTO_UPDATE=1 brew install …
This should also be documented in the --help for install, I think.
BTW, if this is an env variable, it will effect subsequent calls?
On 14 Dec 2016, at 7:22 PM, Baptiste Fontaine notifications@github.com wrote:
It’s documented in the manpage https://github.com/Homebrew/brew/blob/7d31a70373edae4d8e78d91a4cbc05324bebc3ba/Library/Homebrew/manpages/brew.1.md.erb#L202 (man brew):
$ HOMEBREW_NO_AUTO_UPDATE=1 brew install …
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/Homebrew/brew/issues/1670#issuecomment-267096602, or mute the thread https://github.com/notifications/unsubscribe-auth/ABk1jFSzrv6_lIILa8URqA85SA_Up8moks5rICXPgaJpZM4LNK4_.
BTW, if this is an env variable, it will effect subsequent calls?
Only if you export the variable and stay in the same shell. Compare e.g.:
$ A=1 bash -c 'echo $A' # A=1 for that command
1
$ bash -c 'echo $A' # A is not set
$ A=1
$ bash -c 'echo $A' # A is set in the shell but not exported
$ export A=1
$ bash -c 'echo $A' # A is exported
1
Gotcha. I'm turning this into a feature request. Its seems to me as basic
functionality and that on slow Internet connections it crucial.
On 14 Dec 2016 10:58 pm, "Baptiste Fontaine" notifications@github.com
wrote:
BTW, if this is an env variable, it will effect subsequent calls?
Only if you export the variable and stay in the same shell. Compare e.g.:
$ A=1 bash -c 'echo $A' # A=1 for that command
1
$ bash -c 'echo $A' # A is not set$ A=1
$ bash -c 'echo $A' # A is set in the shell but not exported$ export A=1
$ bash -c 'echo $A' # A is exported
1—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Homebrew/brew/issues/1670#issuecomment-267154480, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABk1jBSii3eYfthI0IntlWrBIB5YfRwTks5rIFhcgaJpZM4LNK4_
.
You can export the variable in your shell startup script (e.g. ~/.bashrc); it’ll apply to all shell sessions.
Exactly the opposite, I would like to run this per command, instead of per shell session or all shell sessions!
I had a really slow and flaky internet connection the other day, and an option of running install without updating brew could have been super handy (especially since it wasn't the default behaviour until a while back)
On 15 Dec 2016, at 1:08 AM, Baptiste Fontaine notifications@github.com wrote:
You can export the variable in your shell startup script (e.g. ~/.bashrc); it’ll apply to all shell sessions.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/Homebrew/brew/issues/1670#issuecomment-267185688, or mute the thread https://github.com/notifications/unsubscribe-auth/ABk1jCVj4lNNm-Mqw7ZTw7VgHLZnihDUks5rIHbugaJpZM4LNK4_.
Then prefix each command with HOMEBREW_NO_AUTO_UPDATE=1; it’ll affect only _that_ particular command.
If you use Homebrew/aliases you can setup an alias for this use-case:
brew alias install_no_autoupdate='!HOMEBREW_NO_AUTO_UPDATE=1 brew install'
(you may want to use a shorter command name :smile: )
I dont understand what's the rationale behinh using an env variable instead
of a flag?
On 15 Dec 2016 2:17 pm, "Baptiste Fontaine" notifications@github.com
wrote:
Then prefix each command with HOMEBREW_NO_AUTO_UPDATE=1; it’ll affect
only that particular command.If you use Homebrew/aliases https://github.com/Homebrew/homebrew-aliases
you can setup an alias for this use-case:brew alias install_no_autoupdate='!HOMEBREW_NO_AUTO_UPDATE=1 brew install'
(you may want to use a shorter command name 😄 )
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Homebrew/brew/issues/1670#issuecomment-267314415, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABk1jK1XTph96yJv2fWQIuHVXfQZ2IhXks5rIS_2gaJpZM4LNK4_
.
It’s often something you want globally; not per command. Additionally it’s handled at the brew.sh level and not by the command itself to ensure no Ruby code is loaded before updating.
cc @MikeMcQuaid for an opinion on this.
This should also be documented in the --help for install, I think.
@wildeyes Sorry, I don't agree. This isn't something we want most users to disable.
You can temporarily run export HOMEBREW_NO_AUTO_UPDATE=1 in a shell session if you wish to disable auto-update just for that session. A better alternative may be instead to set HOMEBREW_AUTO_UPDATE_SECS to a higher value (the default is to try and update every 60 seconds).
Here's a use case:
We have scripts per project that setup the environment. Most projects have a specific version of Node that they require so as part of each projects bootstrap we install Node to get npm, then use npm to install a thing called "n", an easy NodeJS version switcher.
The problem comes when I switch to another project, when it's bootstrap gets to node it tries to update it to the latest version of node which fails because it can't symlink it in to place.
We use Brewfiles to control what gets installed, and it's only really Node we want to pin to a certain version but using the env var would restrict all the others too.
Would be nice if I could just add --no-update to a single line.
@Stubbs export HOMEBREW_NO_AUTO_UPDATE=1 is one line too :wink:
It is, but HOMEBREW_NO_AUTO_UPDATE=1 brew bundle would apply to all the files in the bundle.
I actually get around it by doing this: brew "node" unless system '/usr/local/bin/node --version 2>&1 > /dev/null' so it'll not do anythin if any version is installed. Works well enough.
it's only really Node we want to pin to a certain version but using the env var would restrict all the others too.
We specifically don't want you to pin Node to a particular version because then you don't get any security updates. We allow you to use e.g. node@6 for ensuring the version is a specific, support Node version.
Most helpful comment
Then prefix each command with
HOMEBREW_NO_AUTO_UPDATE=1; it’ll affect only _that_ particular command.If you use Homebrew/aliases you can setup an alias for this use-case:
(you may want to use a shorter command name :smile: )