cwd could change, limit search to plugin folder in bundle.

This commit is contained in:
Corey Johnson
2011-08-27 18:18:11 -07:00
parent 8b9066b4b5
commit 896a2c279b
2 changed files with 6 additions and 4 deletions

View File

@@ -153,5 +153,5 @@ bindKey 'toggleProjectDrawer', 'Command-Ctrl-N', (env) ->
## load plugins
plugins = _.map Dir.list("./plugins"), (plugin) ->
require plugin
plugins = _.map Dir.list(Chrome.appRoot() + "/plugins"), (plugin) ->
require plugin

View File

@@ -108,6 +108,9 @@ Chrome =
frame = fullscreenWindow.frameRectForContentRect(fullscreenWindow.screen.frame)
fullscreenWindow.setFrame_display_animate frame, true, true
appRoot: ->
OSX.NSBundle.mainBundle.resourcePath
# Handles the file system
File =
read: (path) ->
@@ -119,8 +122,7 @@ File =
if /~/.test path
OSX.NSString.stringWithString(path).stringByExpandingTildeInPath
else if path.indexOf('./') is 0
root = OSX.NSBundle.mainBundle.resourcePath
"#{root}/#{path}"
"#{Chrome.appRoot}/#{path}"
else
path
isFile: (path) ->