Skip to content

Commit

Permalink
fix doc url. fixed cnpm/cnpmjs.org#29
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Dec 9, 2013
1 parent 0caf0b2 commit 57e8eae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
15 changes: 7 additions & 8 deletions bin/cnpm
Expand Up @@ -79,14 +79,13 @@ var extendsMethd = {
};

if (extendsMethd[action]) {
return program
.command('web', 'open ali-npm web')
.command('check', 'check the dependencies in project')
.command('doc [modulename]', 'open ali-npm document page')
.command('auth', 'auth with email and password of alibaba npm')
.command('publish [moduleName]', 'publish module into ali npm')
.command('notify [moduleName]', 'send module notifies to user in mail group')
.parse(process.argv);
program
.command('web', 'open cnpm web')
.command('check', 'check the dependencies in project')
.command('doc [modulename]', 'open document page')
.command('sync [moduleName]', 'sync module from source npm')
.parse(process.argv);
return;
}

//origin npm with taobao registry
Expand Down
2 changes: 1 addition & 1 deletion bin/cnpm-doc
Expand Up @@ -19,7 +19,7 @@
var open = require('open');
var config = require('../config');

var docurl = config.cnpmHost + '/' + process.argv[2];
var docurl = config.cnpmHost + '/package/' + process.argv[2];

open(docurl, function (err, stdout, stderr) {
if (err) {
Expand Down
6 changes: 5 additions & 1 deletion bin/cnpm-sync
Expand Up @@ -20,11 +20,15 @@ var path = require('path');
var urllib = require('urllib');
var open = require('open');
var npm = require('npm');
var program = require('commander');
var config = require('../config');

program.parse(process.argv);
var args = program.args;

var name;
try {
name = process.argv[2] || require(path.join(process.cwd(), 'package.json')).name;
name = args[0] || require(path.join(process.cwd(), 'package.json')).name;
} catch (err) {
console.log('Read `package.json` file error: %s', err.message);
process.exit(1);
Expand Down

0 comments on commit 57e8eae

Please sign in to comment.