Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Rename auto-update to update-dependents, and update docs to reflect this
  • Loading branch information
isaacs committed Aug 3, 2010
1 parent 62df3c7 commit a0eb2fa
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
8 changes: 8 additions & 0 deletions doc/config.md
Expand Up @@ -79,6 +79,14 @@ Default: true
Automatically activate a package after installation, if there is not an active
version already. Set to "always" to always activate when installing.

### update-dependents

Default: true

Automatically update a package's dependencies after installation, if it is the
newest version installed. Set to "always" to update dependents when a new
version is installed, even if it's not the newest.

### root

Default: `$INSTALL_PREFIX/lib/node`
Expand Down
6 changes: 3 additions & 3 deletions lib/build.js
Expand Up @@ -67,9 +67,9 @@ function buildStep (pkg, cb) {
)
}
function autoUpdate (pkg, cb) {
var auto = npm.config.get("auto-update")
var auto = npm.config.get("update-dependents")
if (!auto) return log(
"auto-update disabled by config", "auto-update", cb)
"update-dependents disabled by config", "update-dependents", cb)
pkg = pkg && pkg._data || pkg
if (auto === "always") {
return npm.commands["update-dependents"]([pkg], cb)
Expand All @@ -79,7 +79,7 @@ function autoUpdate (pkg, cb) {
var versions = Object.keys(inst).sort(semver.sort)
, maxHave = versions.pop()
if (semver.gt(maxHave, pkg.version)) return log(
"downgrade, not updating dependencencies", "auto-update", cb)
"downgrade, not updating dependencencies", "update-dependents", cb)
npm.commands["update-dependents"]([pkg], cb)
})
}
Expand Down
4 changes: 2 additions & 2 deletions lib/update.js
Expand Up @@ -18,7 +18,7 @@ Does the following:
If no packages are specified, then run for all installed
packages.
Depending on config value, auto-update, run steps 4-5
Depending on config value, update-dependents, run steps 4-5
after installation
* always - Run an update after every install, so as to
Expand Down Expand Up @@ -50,7 +50,7 @@ function update (args, cb) {
})
}
function installUpdates (updates, cb) {
npm.config.set("auto-update", true)
npm.config.set("update-dependents", true)
var installList = []
, updateList = []
, preChain = []
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/default-config.js
Expand Up @@ -12,7 +12,7 @@ if (!process.execPath) {

module.exports =
{ "auto-activate" : "always"
, "auto-update" : true
, "update-dependents" : true
, "auto-deactivate" : true
, tag : "latest"
, root : path.join(process.execPath, "..", "..", "lib", "node")
Expand Down
6 changes: 6 additions & 0 deletions man/config.1
Expand Up @@ -109,6 +109,12 @@ Default: true
.P
Automatically activate a package after installation, if there is not an active version already\. Set to "always" to always activate when installing\.
.
.SS "update\-dependents"
Default: true
.
.P
Automatically update a package\'s dependencies after installation, if it is the newest version installed\. Set to "always" to update dependents when a new version is installed, even if it\'s not the newest\.
.
.SS "root"
Default: \fB$INSTALL_PREFIX/lib/node\fR
.
Expand Down

0 comments on commit a0eb2fa

Please sign in to comment.