diff --git a/lib/concrete.js b/lib/concrete.js index bb6c5ef..91672f9 100644 --- a/lib/concrete.js +++ b/lib/concrete.js @@ -1,7 +1,7 @@ (function() { var argv, colors, git, optimist, startServer, usage, version; process.title = 'Concrete'; - version = '0.0.1'; + version = '0.0.2'; colors = require('colors'); usage = 'Usage: concrete [-hpv] path_to_git_repo'; optimist = require('optimist'); diff --git a/lib/git.js b/lib/git.js index 23aebd9..5d9c6aa 100644 --- a/lib/git.js +++ b/lib/git.js @@ -15,6 +15,10 @@ var path; readyCallback = callback; path = require('path'); + if (target.toString().charAt(0) !== '/') { + target = process.cwd() + '/' + target; + } + process.chdir(target); git.target = path.normalize(target + '/.git/'); git.failure = path.normalize(target + '/.git/hooks/build-failed'); git.success = path.normalize(target + '/.git/hooks/build-worked'); @@ -23,7 +27,6 @@ console.log(("'" + target + "' is not a valid Git repo").red); process.exit(1); } - process.chdir(target); getBranch(); return getRunner(); }); @@ -51,7 +54,6 @@ } }; getBranch = function() { - console.log(process.cwd()); return exec('git config --get ' + git.config.branch, __bind(function(error, stdout, stderr) { if (error != null) { git.branch = 'master'; diff --git a/package.json b/package.json index 74a5457..0341841 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "concrete", - "version": "0.0.1", + "version": "0.0.2", "description": "A minimalistic Continuous Integration server", "author": "Ryan Kee (http://ryankee.com)", "preferGlobal" : true, diff --git a/src/concrete.coffee b/src/concrete.coffee index 91b13c9..628df57 100644 --- a/src/concrete.coffee +++ b/src/concrete.coffee @@ -1,5 +1,5 @@ process.title = 'Concrete' -version = '0.0.1' +version = '0.0.2' # cli colors colors = require 'colors' @@ -52,4 +52,4 @@ startServer = -> # check the path and start the git request git = require '../lib/git' -git.init(argv._[0], startServer) \ No newline at end of file +git.init(argv._[0], startServer) diff --git a/src/git.coffee b/src/git.coffee index 5697691..a5c8bd9 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -15,6 +15,9 @@ git = module.exports = init: (target, callback) -> readyCallback = callback path = require 'path' + if target.toString().charAt(0) isnt '/' + target = process.cwd()+'/'+target + process.chdir target git.target = path.normalize target+'/.git/' git.failure = path.normalize target+'/.git/hooks/build-failed' git.success = path.normalize target+'/.git/hooks/build-worked' @@ -22,7 +25,6 @@ git = module.exports = if exists is no console.log "'#{target}' is not a valid Git repo".red process.exit 1 - process.chdir target getBranch() getRunner() @@ -43,7 +45,6 @@ git = module.exports = next() getBranch = -> - console.log process.cwd() exec 'git config --get ' + git.config.branch, (error, stdout, stderr)=> if error? git.branch = 'master' diff --git a/src/server.coffee b/src/server.coffee index cba8e24..9f3e3ab 100644 --- a/src/server.coffee +++ b/src/server.coffee @@ -27,22 +27,16 @@ app.configure -> coffeeDir = __dirname + '/views' publicDir = __dirname + '/public' app.use express.compiler src: coffeeDir, dest: publicDir, enable: ['coffeescript'] - # app.use express.static publicDir app.use express.logger() - # app.use express.bodyParser() - # app.use express.methodOverride() - # app.use express.cookieParser() - # app.use express.session({secret:"concrete"}) app.use app.router - app.use express.static __dirname + '/public' + app.use express.static __dirname + '/public' app.configure 'development', -> app.use express.errorHandler dumpExceptions: on, showStack: on app.configure 'production', -> app.use express.errorHandler dumpExceptions: on, showStack: on - # app.use express.errorHandler() app.get '/', (req, res) -> jobs.getAll (jobs)->