Permalink
Browse files

[fix] commands.py: launch now works with nodejs and npm default insta…

…llation
  • Loading branch information...
1 parent 56cd9c9 commit 076225ec07b780b61cf4e3876ef7a7b97fff15f3 @OpaOnWindowsNow OpaOnWindowsNow committed Jun 29, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 commands.py
View
7 commands.py
@@ -13,7 +13,12 @@ def kill(self,dirname,exe):
def launch(self,dirname,exe):
exe = os.path.join(dirname,exe)
- self.view.window().run_command('exec', {'cmd': [exe+" -p 2000"], 'working_dir':dirname, 'shell':True} )
+ if sys.platform.startswith('win'):
+ node_path = os.path.join(os.getenv("APPDATA"),"npm","node_modules")
+ os.environ["NODE_PATH"] = node_path
+ self.view.window().run_command('exec', {'cmd': ["node "+exe+" -p 2000"], 'working_dir':dirname, 'shell':True} )
+ else:
+ self.view.window().run_command('exec', {'cmd': [exe+" -p 2000"], 'working_dir':dirname, 'shell':True} )
class RunOpaBuildCommand(sublime_plugin.TextCommand):
def run(self, view):

0 comments on commit 076225e

Please sign in to comment.