mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
move Dir into fs.coffee and commonjs it
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user