       'handlebars'
       'ember'
       'tower'
-      'bootstrap/bootstrap-dropdown'
+      "bootstrap#{_path.sep}bootstrap-dropdown"
     ]
     bundlePath  = null
 
     processEach = (keys, bundle, next) =>
       currentCallback = null
-      bundlePath      = "./dist/#{bundle}"
+      bundlePath      = ".#{_path.sep}dist#{_path.sep}#{bundle}"
 
       writeStream     = fs.createWriteStream(bundlePath, flags: 'w', encoding: 'utf-8')
       writeStream.on 'drain', ->

  try
    towerPath = require.resolve('tower') # will fail on tower repo
  catch error
    towerPath = _path.join(__dirname, '../../../index.js')

  grunt.registerMultiTask 'templates', 'Compile templates', ->
    name  = ""
    taskDone = @async()
    
    files   = grunt.file.expand(['app/templates/**/*.coffee'])
    result  = []

    pathSeparator = Tower.pathSeparator

        ""

    buildIt = ->
      #fs.exists 
      fs.mkdirSync(".#{_path.sep}dist") unless fs.existsSync(".#{_path.sep}dist")
      content = compileFile(".#{_path.sep}packages#{_path.sep}tower", ".#{_path.sep}packages#{_path.sep}tower#{_path.sep}client.coffee", 0).replace /Tower\.version *= *.+\n/g, (_) ->
        version = """
    Tower.version = "#{grunt.config('pkg.version')}"

    """
      fs.writeFileSync ".#{_path.sep}dist#{_path.sep}tower.coffee", content
      mint.coffee content, bare: false, (error, result) ->
        result = grunt.config.process('meta.banner') + result
        console.error error.stack if error
        fs.writeFileSync ".#{_path.sep}dist#{_path.sep}tower.js", result

    buildIt()