Permalink
Browse files

fix install

  • Loading branch information...
1 parent f8b153c commit 789341ce34227807676d02ff71a964ce7cee42fc Hsiaoming Yang committed Mar 19, 2013
Showing with 10 additions and 9 deletions.
  1. +7 −4 lib/install.js
  2. +1 −1 lib/sdk/git.js
  3. +1 −1 lib/sdk/module.js
  4. +1 −3 lib/sdk/yuan.js
View
@@ -122,6 +122,7 @@ function fetch(query, callback) {
if (err) {
fetchCache(data, function(err, result) {
if (err) {
+ log.warn('warn', err);
fetchGit(data, callback);
} else {
callback(null, result);
@@ -189,11 +190,13 @@ function fetchGit(pkg, callback) {
var revision = pkg.revision || pkg.version || 'HEAD';
log.debug('revision', revision);
if (fs.existsSync(dest)) {
- git.pull({cwd: dest}, function(err) {
- err && log.warn('git', err);
- git.checkout(revision, {cwd: dest}, function(err) {
+ git.checkout('master', {cwd: dest}, function(err) {
+ git.pull({cwd: dest}, function(err) {
err && log.warn('git', err);
- callback(null, dest);
+ git.checkout(revision, {cwd: dest}, function(err) {
+ err && log.warn('git', err);
+ callback(null, dest);
+ });
});
});
return;
View
@@ -8,7 +8,7 @@ git.revision = function(options, callback) {
};
git.checkout = function(rev, options, callback) {
- exec('git checkout ' + rev, options, callback);
+ exec('git checkout -q ' + rev, options, callback);
};
git.clone = function(url, dest, options, callback) {
View
@@ -76,7 +76,7 @@ exports.plainDependencies = function(deps) {
};
function parseIdentify(id) {
- var regex = /^((?:[a-z][a-z0-9\-]*\/)?[a-z][a-z0-9\-]*)\/(\d+\.\d+\.\d+)\/([a-z0-9\-\/]+)$/;
+ var regex = /^((?:[a-z][a-z0-9\-]*\/)?[a-z][a-z0-9\-]*)\/(\d+\.\d+\.\d+)\/([a-z0-9\-\/\.]+)$/;
var match = id.match(regex);
if (!match) return null;
var keys = match[1].split('/');
View
@@ -316,9 +316,7 @@ function sort(versions) {
var ret = {};
vers.forEach(function(v) {
var pkg = versions[v];
- if (pkg.filename) {
- ret[v] = pkg;
- }
+ ret[v] = pkg;
});
return ret;
}

0 comments on commit 789341c

Please sign in to comment.