 	
 	# Watch
 	watch: (next) ->
+		# Log
+		console.log 'Setting up watching...'
+		
 		# Watch the src directory
 		watch.createMonitor docpad.options.srcPath, (monitor) ->
-			
+			# Log
+			console.log 'Set up watching'
+
 			# File Changed
 			monitor.on 'changed', (fileFullPath,newStat,oldStat) ->
 				docpad.generate ->

async = require 'async'
watch = require 'watch'
util = require 'bal-util'
mongoose = require 'mongoose'
Schema = mongoose.Schema 
SchemaTypes = Schema.Types 

	# Generate
	generate: (next) ->
		# Check
		if docpad.generating
			console.log 'Generate request received, but we are already busy generating...'
			return
		else
			console.log 'Generating...'
			docpad.generating = true
		
		# Continue
		path.exists docpad.options.srcPath, (exists) ->
			# Check
			if exists is false
				throw new Error 'Cannot generate website as the src dir was not found'
			
			# Log
			console.log 'Cleaning the out path'
			
			# Continue
			util.rmdir docpad.options.outPath, (err,list,tree) ->
				if err
					console.log 'Failed to clean the out path '+docpad.options.outPath
					throw err
				console.log 'Cleaned the out path'
				docpad.generateClean ->
					docpad.generateParse ->
						docpad.generateRelations ->
