 		Helpers.buildDeb @async()
 
 	Helpers =
-		installService: (repo_src, dir, callback = (error) ->) ->
-			Helpers.cloneGitRepo repo_src, dir, (error) ->
+		installService: (service, callback = (error) ->) ->
+			Helpers.cloneGitRepo service, (error) ->
 				return callback(error) if error?
-				Helpers.installNpmModules dir, (error) ->
+				Helpers.installNpmModules service.name, (error) ->
 					return callback(error) if error?
-					Helpers.runGruntInstall dir, (error) ->
+					Helpers.runGruntInstall service.name, (error) ->
 						return callback(error) if error?
 						callback()
 


SERVICES = [{
	name: "web"
	repo: "https://github.com/sharelatex/web-sharelatex.git"
}, {
	name: "document-updater"
	repo: "https://github.com/sharelatex/document-updater-sharelatex.git"

		do (service) ->
			grunt.registerTask "install:#{service.name}", "Download and set up the #{service.name} service", () ->
				done = @async()
				Helpers.installService(service, done)
			grunt.registerTask "update:#{service.name}", "Checkout and update the #{service.name} service", () ->
				done = @async()
				Helpers.updateService(service.name, done)
