Permalink
Browse files

fix for adding hooks

  • Loading branch information...
1 parent 16e0f12 commit 0d34b02fa37a82fcd6e061b0c78a8a69d1df70c4 @substack committed Apr 10, 2012
Showing with 11 additions and 10 deletions.
  1. +10 −9 bin/cmd.js
  2. +1 −1 package.json
View
@@ -15,15 +15,6 @@ function remote (cb) {
}
withConfig(function (config) {
- var doc = {
- name : 'travis',
- config : {
- token : config.token,
- domain : '',
- user : config.user,
- },
- };
-
remote(function (err, repo) {
if (err) console.error(err)
else if (process.argv[2] === 'test') {
@@ -77,13 +68,23 @@ function testHook (config, repo) {
function addHook (config, repo) {
var uri = hookUri(config, repo);
+ var doc = {
+ name : 'travis',
+ config : {
+ token : config.token,
+ domain : '',
+ user : config.user,
+ },
+ };
+
getHook(uri, function (err, hook) {
if (err) return console.error(err);
if (hook) return console.log('this repo already has a travis hook');
var opts = {
uri : uri,
body : JSON.stringify(doc),
+ json : true
};
request.post(opts, function (err, res, body) {
if (err) console.error(err);
View
@@ -1,7 +1,7 @@
{
"name" : "travisify",
"description" : "add travis-ci hooks to github",
- "version" : "0.0.0",
+ "version" : "0.0.1",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/travisify.git"

0 comments on commit 0d34b02

Please sign in to comment.