   getSlimPath: (path) ->
     path.replace(HAML_EXTENSION_REGEXP, '.slim')
 
+  deleteHamlFile: (filePath) ->
+    fs.unlink(filePath)
+
   parser: ->
     @_parser ?= new @Parser()
 


      @writeToSlimFile(filePath, compiler.buffer) if writeToFile

  convertDir: (dirPath, writeToFile = true) ->
    dirPath = @getAbsolutePath(dirPath)
    files = []



    console.log "Converting files:"
    Q
      .allSettled(_.map(files, (filePath) =>
        console.log(filePath)
        @convertFile(filePath, writeToFile).then =>
          @deleteHamlFile(filePath) if removeHamlFiles
      ))
      .catch((e) ->
        console.log e
