Permalink
Browse files

Fixes #34 - Added --set-github to change the modules github owner (fo…

…r orgs)
  • Loading branch information...
1 parent 22981d7 commit 480172b49c6a47b50605cb5010c47454e378494e @davglass davglass committed Dec 27, 2012
Showing with 21 additions and 7 deletions.
  1. +3 −0 lib/args.js
  2. +9 −3 lib/cmds/create.js
  3. +9 −4 lib/cmds/info.js
View
@@ -8,6 +8,9 @@ var nopt = require('nopt'),
cmds = require('./cmds'),
known = {
'set-hide': Boolean,
+ 'set-path': String,
+ 'set-repo': String,
+ 'set-github': String,
color: Boolean,
watch: Boolean,
quiet: Boolean,
View
@@ -54,10 +54,14 @@ mods = {
}
this.repo = this.options.parsed.repo;
+ this.github = this.options.parsed.github;
if (this.origin && !this.repo) {
this.repo = this.origin.replace('.git', '').split('/')[1];
}
+ if (this.origin && !this.github) {
+ this.github = this.origin.split(':')[1].split('/')[0];
+ }
this.path = this.options.parsed.path || 'src/gallery-' + mod;
@@ -98,7 +102,7 @@ mods = {
print: function() {
log.log('-------------------------------------------------------------------------');
log.info('yogi found this git origin: ' + this.origin);
- log.info('and this repo: ' + this.repo);
+ log.info('and this repo: ' + this.github + '/' + this.repo);
log.info('using this path: ' + this.path);
log.info('of type: ' + this.type);
log.info('with this license: ' + this.license);
@@ -162,7 +166,7 @@ mods = {
log.log('--------------------------------------------------------------------------------------');
log.info('yogi found this git origin: ' + this.origin);
log.info('in this location: ' + this.root);
- log.info('and this repo: ' + this.repo);
+ log.info('and this repo: ' + this.github + '/' + this.repo);
log.info('using this path: ' + this.path);
log.info('of type: ' + this.type);
log.info('with this license: ' + this.license);
@@ -195,6 +199,7 @@ mods = {
path: this.path,
name: this.module,
repo: this.repo,
+ github: this.github,
origin: this.origin
}, function() {
});
@@ -206,7 +211,8 @@ mods = {
repo: this.repo,
path: this.path,
type: this.type,
- license: this.license
+ license: this.license,
+ github: this.github
}, function(err, json) {
if (err) {
log.bail(err);
View
@@ -28,8 +28,8 @@ mods = {
}
this.module = module;
- if (options.parsed['set-repo'] || options.parsed['set-path'] || options.parsed['set-hide']) {
- this.set(options.parsed['set-repo'], options.parsed['set-path'], options.parsed['set-hide']);
+ if (options.parsed['set-repo'] || options.parsed['set-path'] || options.parsed['set-hide'] || options.parsed['set-github']) {
+ this.set(options.parsed['set-repo'], options.parsed['set-path'], options.parsed['set-hide'], options.parsed['set-github']);
return;
}
if (approve) {
@@ -69,7 +69,7 @@ mods = {
});
});
},
- set: function(repo, path, hide) {
+ set: function(repo, path, hide, github) {
var self = this;
log.info('updating info for this module:');
if (repo) {
@@ -78,13 +78,17 @@ mods = {
if (path) {
log.info('setting path to: ' + path);
}
+ if (github) {
+ log.info('setting github user to: ' + github);
+ }
if (hide) {
log.info('hiding this module on the site');
}
api.put('/gallery/' + this.module + '/set', {
repo: repo,
path: path,
- hide: hide
+ hide: hide,
+ github: github
}, function(e) {
if (e) {
log.bail(e);
@@ -237,6 +241,7 @@ mods = {
'--set-repo=<repo> Set the name of the repo if you do not use yui3-gallery',
'--set-path=<path> Set the path to the module under the repo, defaults to src/',
'--set-hide Hide the module on the site (default for modules created with yogi)',
+ '--set-github=<github username> Set the github username for this repo, defaults to the module owner',
'--approve Request module approval'
];
}

0 comments on commit 480172b

Please sign in to comment.