         task = "shell:writeVersion:#{appName}:#{version}"
         grunt.task.run(task)
 
+      when 'dev'
+        grunt.task.run("shell:writeMode:#{NODE_ENV}")
+
   grunt.registerTask 'compile', (type) ->
     switch type
       when 'js'

    'concat:js'
    'concat:css'
    'concat:html'

    'optimize'
    'link'

          content = "module.#{appName}.version = \"#{version}\";"
          "mkdir -p tmp; echo '#{content}' >> tmp/version.js"

      writeMode:
        command: (mode) ->
          "echo 'module.mode = \"#{mode}\";' >> public/script.js"

      make:
        command: (task, path = '.') ->
          "BASE=#{path} make #{task}"
