             default: false
 
     files: ->
-        appPath = process.cwd()
-        fullPath = path.join appPath, '/slides/list.json'
-        list = require fullPath
+        fullPath = @destinationPath('slides/list.json')
+        list = @fs.readJSON fullPath
 
         if @options.markdown
             @filename = "#{@_.slugify(@name)}.md"

            @log.info "Appending slides/#{@filename} to slides/list.json."
            list.push @filename

        fs.writeFileSync fullPath, JSON.stringify list, null, 4

fs = require 'fs'
path = require 'path'
yeoman = require 'yeoman-generator'

module.exports = class SlideGenerator extends yeoman.generators.NamedBase
    constructor: ->
