         "theme-update"
         "theme-save"
         "amsf-update"
+      ]
+
+  grunt.registerTask "flatten_check", "Build site with jekyll", ->
+    if grunt.config.get(['config']).flatten_base
+      grunt.task.run [
+        "shell:move_flatten_base"
       ]
 
   grunt.registerTask "build", "Build site with jekyll", [

        command: "git checkout release && git pull && git merge master --no-edit && git push && git checkout master && git push"

      move_flatten_base:
        command: if "<%= config.flatten_base %>" then "mv <%= config.dist %><%= config.base %>/* <%= config.dist %>/"

    concurrent:
      options:

    "uglify:sw"
    "sri_hash:dist"
    "doctype"
    "flatten_check"
    "cleanempty"
  ]

