mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
project can find sub-urls
This commit is contained in:
@@ -7,8 +7,6 @@ fs = require 'fs'
|
||||
|
||||
module.exports =
|
||||
class Tree extends Extension
|
||||
ignorePattern: /^(\.git|\.xcodeproj|\.DS_Store)$/
|
||||
|
||||
project: null
|
||||
|
||||
constructor: ->
|
||||
@@ -25,8 +23,8 @@ class Tree extends Extension
|
||||
super
|
||||
|
||||
urls: (root=@project.url) ->
|
||||
_.compact _.map (fs.list root), (url) =>
|
||||
return if @ignorePattern.test url
|
||||
_.map (@project.urls root), (url) =>
|
||||
type: if fs.isDirectory url then 'dir' else 'file'
|
||||
label: url.replace(root, "").substring 1
|
||||
url: url
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ module.exports =
|
||||
class Project extends Resource
|
||||
window.resourceTypes.push this
|
||||
|
||||
ignorePattern: /(\.git|\.xcodeproj|\.DS_Store)$/
|
||||
|
||||
html:
|
||||
$ '<div></div>'
|
||||
|
||||
@@ -71,3 +73,6 @@ class Project extends Resource
|
||||
parent = @url.replace /([^\/])$/, "$1/"
|
||||
child = url.replace /([^\/])$/, "$1/"
|
||||
child.match "^" + parent
|
||||
|
||||
urls: (root=@url) ->
|
||||
_.reject (fs.list root), (url) => @ignorePattern.test url
|
||||
|
||||
Reference in New Issue
Block a user