Skip to content

Commit

Permalink
command/install: finish entry logic; #59
Browse files Browse the repository at this point in the history
  • Loading branch information
kaelzhang committed Aug 10, 2014
1 parent ebf4ed0 commit c0a5f24
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions lib/command/install/index.js
Expand Up @@ -73,25 +73,24 @@ exports.run = function(options, callback) {
cache.save_origin(name, version);

self.one(name, version, {
key: options.dependency_key,
dir: options.dir,
cache: cache,
queue: q,
recursive: options.recursive,
emitter: emitter,
documents: documents,
save: options.save,
stable: options.stable

// If stable only, or save a dependency, we will force to stable version
}, options.stable || options.save);
cache : cache,
queue : q,
emitter : emitter,
documents : documents,

key : options.dependency_key,
dir : options.dir,
recursive : options.recursive,
stable : options.stable
prerelease: options.prerelease
}, options.save);
});
};


// Install a single package
// @param {Boolean} entry If entry, neuropil will check stable versions
exports.one = function(name, version, options, force_stable) {
exports.one = function(name, version, options, save) {
// prevent duplicate installation
if (options.cache.exists(name, version)) {
return;
Expand Down Expand Up @@ -122,9 +121,10 @@ exports.one = function(name, version, options, force_stable) {
// `String` Restrict ranges within a specific prerelease
prerelease: options.prerelease,
// `Boolean` Stable needs special treatment
stable: force_stable,
stable: options.stable,
// `Boolean`
save: options.save
save: save

}, callback)
.on('dependencies', function(dependencies) {
if (!options.recursive) {
Expand All @@ -135,9 +135,8 @@ exports.one = function(name, version, options, force_stable) {
self.one(
dep_name, dependencies[dep_name], options,

// If `options.recursive_stable === true`,
// we will force stable version for installing recursively
options.stable
// We won't save packages recursively
false
);
}
})
Expand Down

0 comments on commit c0a5f24

Please sign in to comment.