 fs     = require 'fs'
 prompt = require 'prompt'
 yaml   = require 'js-yaml'
+
+popular_modules = [
+	'official.readme'
+	'official.license'
+	'official.authors'
+	'official.express'
+	'official.laravel'
+	'official.rails'
+	'official.gorm'
+]
 
 initProject = (opts, path) ->
 	# validate name

	# create crystal config
	fs.writeFileSync "#{path}/.crystal/config.yml", config
	
	console.log 'Crystal initialization is complete.'
	
init = (opts) ->
	

	if opts.description
		config.description = opts.description
	
	# add modules to config
	if opts.modules
		config.modules = {}
		for i in opts.modules
			module = popular_modules[parseInt(i)-1]
			config.modules[module] = 'latest'
	
	# convert config obj to yaml doc
	config = yaml.safeDump config
