move Dir into fs.coffee and commonjs it

This commit is contained in:
Chris Wanstrath
2011-09-03 23:11:35 -07:00
parent 884686f55f
commit 8b0b0e4ea3
6 changed files with 37 additions and 25 deletions

View File

@@ -1,7 +1,8 @@
$ = require 'jquery'
_ = require 'underscore'
{Chrome, Dir, File, Process} = require 'osx'
{Chrome, Process} = require 'osx'
File = require 'fs'
Editor = require 'editor'
bindKey = Editor.bindKey
@@ -40,10 +41,10 @@ exports.reload = ->
$('#project li').remove()
files = Dir.list dir
files = File.list dir
listItems = _.map files, (path) ->
filename = path.replace(dir, "").substring 1
type = if Dir.isDir(path) then 'dir' else 'file'
type = if File.isDir(path) then 'dir' else 'file'
"<li class='#{type}' path='#{encodeURIComponent path}'>#{filename}</li>"
$('#project .files').append listItems.join '\n'