 fs = require 'fs'
 path = require 'path'
 sys = require 'util'
+child_process = require 'child_process'
+EventEmitter = require('events').EventEmitter
+
 caterpillar = require 'caterpillar'
 util = require 'bal-util'
-child_process = require('child_process')
+_ = require 'underscore'
+
 growl = null
 express = null
 watch = null
 queryEngine = null
-_ = require 'underscore'
+
 PluginLoader = require "#{__dirname}/plugin-loader.coffee"
 require "#{__dirname}/prototypes.coffee"
+
 exec = (commands,options,callback) ->
 	# Sync
 	tasks = new util.Group callback

		config.corePath or= @config.corePath
		config.rootPath or= process.cwd()

		# Docpad Configuration
		docpadPackagePath = "#{config.corePath}/package.json"
		docpadPackageData = {}
		if path.existsSync docpadPackagePath

			rest: false
		plugins: {}
		
		# Exchange
		exchange:
			# Skeletons
			skeletons:
				kitchensink:
					repo: 'https://github.com/balupton/kitchensink.docpad.git'
					description: 'A skeleton that includes everything'
				canvas:
					repo: 'https://github.com/balupton/canvas.docpad.git'
					description: 'A blank canvas for docpad'
			# Plugins
			plugins: {}
		
		# DocPad Paths
		corePath: "#{__dirname}/.."
		libPath: "#{__dirname}"
		mainPath: "#{__dirname}/docpad.coffee"
		pluginPath: "#{__dirname}/plugin.coffee"

		# Website Paths
		rootPath: null
