Skip to content

Commit

Permalink
fixed repo bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ryankee committed Sep 16, 2011
1 parent 1f42c9a commit 2cd179a
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 25 deletions.
17 changes: 9 additions & 8 deletions lib/git.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion lib/public/concrete.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion lib/runner.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
app.configure(function() {
var coffeeDir, publicDir;
app.set('views', __dirname + '/views');
app.set('quiet', true);
app.set('view engine', 'coffee');
app.register('.coffee', require('coffeekup').adapters.express);
app.set('view options', {
Expand Down
5 changes: 3 additions & 2 deletions lib/views/js/concrete.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $(document).ready ->
return false
setTimeout ->
updateJob job
, 100
, 1000
, 'json'

outcomeTemplate = ->
Expand All @@ -46,6 +46,7 @@ $(document).ready ->
$('button.build').click (event) ->
closeAll()
$('button.build').hide()
$('li.nojob').hide()
$.post '/', (data) ->
if $('ul.jobs').find('li.nojob').length > 0
$('ul.jobs').find('li.nojob').first().remove()
Expand All @@ -58,4 +59,4 @@ $(document).ready ->
return false

$('li.job').each (iterator, job)->
addClick job
addClick job
21 changes: 11 additions & 10 deletions src/git.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ git = module.exports =

init: (target, callback) ->
readyCallback = callback
git.target = target+'.git/'
git.failure = target+'.git/hooks/build-failed'
git.success = target+'.git/hooks/build-worked'
path = require 'path'
git.target = path.normalize target+'/.git/'
git.failure = path.normalize target+'/.git/hooks/build-failed'
git.success = path.normalize target+'/.git/hooks/build-worked'
path.exists git.target, (exists)->
if exists is no
console.log "'#{target}' is not a valid Git repo".red
Expand All @@ -43,19 +43,20 @@ git = module.exports =
next()

getBranch = ->
console.log process.cwd()
exec 'git config --get ' + git.config.branch, (error, stdout, stderr)=>
if error?
console.log "#{error}".red
process.exit 1
git.branch = 'master'
gitContinue()
else
git.branch = stdout.toString().replace /[\s\r\n]+$/, ''
git.branch = 'none' if git.branch is ''
git.branch = 'master' if git.branch is ''
gitContinue()

getRunner = ->
exec 'git config --get ' + git.config.runner, (error, stdout, stderr)=>
if error?
console.log "#{error}".red
console.log "Git.getRunner: #{error}".red
process.exit 1
else
git.runner = stdout.toString().replace /[\s\r\n]+$/, ''
Expand All @@ -69,8 +70,8 @@ gitContinue = ->
return no

if git.runner is 'none'
console.log 'You must specify a Git runner'.red
console.log 'Git.gitContinue: You must specify a Git runner'.red
process.exit 1
else if git.runner is ''
return no
readyCallback()
return no
readyCallback()
2 changes: 1 addition & 1 deletion src/runner.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runNextJob = ->

runTask = (next)->
jobs.updateLog jobs.current, "Executing '#{git.runner}'"
exec git.runner, (error, stdout, stderr)=>
exec git.runner,{maxBuffer: 1024*1024}, (error, stdout, stderr)=>
if error?
err = error.toString()
jobs.updateLog jobs.current, "<span class='output error'>#{err}</span>", ->
Expand Down
4 changes: 2 additions & 2 deletions src/server.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ app = module.exports = express.createServer()

app.configure ->
app.set 'views', __dirname + '/views'

app.set 'quiet', yes
# use coffeekup for html markup
app.set 'view engine', 'coffee'
app.register '.coffee', require('coffeekup').adapters.express
Expand Down Expand Up @@ -81,4 +81,4 @@ app.post '/', (req, res) ->
console.log job
res.json job
else
res.redirect '/'
res.redirect '/'

0 comments on commit 2cd179a

Please sign in to comment.