 
 API_ENDPOINT = 'http://paras.rulemotion.com:1337'
 HAKI_PATH = '/home/haki'
+POLLING_INTERVAL = 30000
 
 try
 	state = require('./state.json')

async.series(tasks, (error, results) ->
	if (error)
		console.error(error)
	else
		console.log('Bootstrapped')
)

	(callback) -> fs.mkdir('hakiapp', callback)
	(callback) -> exec('git init', cwd: 'hakiapp', callback)
	(callback) -> exec("git remote add origin #{state.giturl}", cwd: 'hakiapp', callback)
	(callback) -> console.log('Bootstrapped') ; callback()
]

updateRepo = (callback) ->
	tasks1 = [
		(callback) -> setTimeout(callback, POLLING_INTERVAL)
		(callback) -> exec('git pull', cwd: 'hakiapp', callback)
		(stdout, stderr, callback) -> exec('git rev-parse HEAD', cwd: 'hakiapp', callback)
		(stdout, stderr, callback) -> callback(null, stdout.trim())
	]

	tasks2 = [
		(callback) -> exec('npm install', cwd: 'hakiapp', callback) if fs.existsSync('package.json')
		(callback) -> exec('foreman start', cwd: 'hakiapp', callback) if fs.existsSync('Procfile')
	]

	async.waterfall(tasks1, (error, hash) ->
