 					grunt.log.write "OK."
 					return callback()
 
-		buildUpstartScripts: () ->
-			template = fs.readFileSync("package/upstart/sharelatex-template.conf").toString()
-			for service in SERVICES
-				fs.writeFileSync "package/upstart/sharelatex-#{service.name}.conf", template.replace(/__SERVICE__/g, service.name)

			proc.on "close", () ->
				callback()

		updateGitRepo: (service, callback = (error) ->) ->
			dir = service.name
			proc = spawn "git", ["checkout", service.version], cwd: dir, stdio: "inherit"
			proc.on "close", () ->
				proc = spawn "git", ["pull"], cwd: dir, stdio: "inherit"
				proc.on "close", () ->
					callback()

		createNewRelease: (service, version, callback = (error) ->) ->
			dir = service.name
			proc = spawn "sed", [
				"-i", "",
				"s/\"version\".*$/\"version\": \"#{version}\",/g",
				"package.json"
			], cwd: dir, stdio: "inherit"
			proc.on "close", () ->
				proc = spawn "git", ["commit", "-a", "-m", "Release version #{version}"], cwd: dir, stdio: "inherit"
				proc.on "close", () ->
					proc = spawn "git", ["tag", "v#{version}"], cwd: dir, stdio: "inherit"
					proc.on "close", () ->
						proc = spawn "git", ["push"], cwd: dir, stdio: "inherit"
						proc.on "close", () ->
							proc = spawn "git", ["push", "--tags"], cwd: dir, stdio: "inherit"
							proc.on "close", () ->
								callback()

		installNpmModules: (service, callback = (error) ->) ->
			dir = service.name

		Helpers.checkAspell @async()
	grunt.registerTask "check:make", "Check that make is installed", () ->
		Helpers.checkMake @async()

	grunt.registerTask "check", "Check that you have the required dependencies installed", ["check:redis", "check:latexmk", "check:s3", "check:fs", "check:aspell"]



	grunt.registerTask 'migrate', "compile migrations and run them", ['coffee:migrate', 'shell:migrate']
