mirror of
https://github.com/atom/atom.git
synced 2026-02-09 06:05:11 -05:00
21 lines
378 B
CoffeeScript
21 lines
378 B
CoffeeScript
fs = require 'fs'
|
|
File = require 'file'
|
|
|
|
module.exports =
|
|
class Directory
|
|
constructor: (@path) ->
|
|
|
|
getName: ->
|
|
fs.base(@path) + '/'
|
|
|
|
getEntries: ->
|
|
directories = []
|
|
files = []
|
|
for path in fs.list(@path)
|
|
if fs.isDirectory(path)
|
|
directories.push(new Directory(path))
|
|
else
|
|
files.push(new File(path))
|
|
directories.concat(files)
|
|
|