From 896a2c279b9a81dd279169bf6ee2baa44e7e0e66 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Sat, 27 Aug 2011 18:18:11 -0700 Subject: [PATCH] cwd could change, limit search to plugin folder in bundle. --- src/atomicity.coffee | 4 ++-- src/osx.coffee | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/atomicity.coffee b/src/atomicity.coffee index 4f548eda5..3980dc6c1 100644 --- a/src/atomicity.coffee +++ b/src/atomicity.coffee @@ -153,5 +153,5 @@ bindKey 'toggleProjectDrawer', 'Command-Ctrl-N', (env) -> ## load plugins -plugins = _.map Dir.list("./plugins"), (plugin) -> - require plugin \ No newline at end of file +plugins = _.map Dir.list(Chrome.appRoot() + "/plugins"), (plugin) -> + require plugin diff --git a/src/osx.coffee b/src/osx.coffee index 54a8241f7..ea1328cdd 100644 --- a/src/osx.coffee +++ b/src/osx.coffee @@ -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) ->