   constructor: (filename) ->
     if not path.existsSync filename
       console.log "Path doesn't exist, creating..."
-      do @createLibrary
+      @createLibrary()
       return
 
     @library = fs.readFileSync filename, 'utf-8'

    template = fs.readFileSync __dirname + "/views/single.html", "utf-8"
    for photo in @library.photos
      html = eco.render template, photo: photo
      fs.writeFileSync 
      @finalizeFile html, "build/#{do photo.getHtmlName}"

  finalizeFile: (content, filename) ->
    rendered = eco.render baseTemplate, content: content

      console.log 'done'

  export: ->
    @generateIndex
    @generateAlbums
    @generatePages


program = require 'commander'
