From cec037333f292bc3e4804d117756c86acc1f45c5 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki & Nathan Sobo Date: Tue, 12 Mar 2013 08:50:09 -0700 Subject: [PATCH] Add all resource paths to NODE_PATH env var --- native/atom_window_controller.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/native/atom_window_controller.mm b/native/atom_window_controller.mm index 7a74fdf22..6bde507e3 100644 --- a/native/atom_window_controller.mm +++ b/native/atom_window_controller.mm @@ -54,7 +54,15 @@ _resourcePath = [_resourcePath stringByStandardizingPath]; [_resourcePath retain]; - NSString *nodePath = [NSString stringWithFormat:@"%@/node_modules", _resourcePath]; + NSArray *paths = [NSArray arrayWithObjects:@"spec", @"benchmark", + @"src/stdlib", @"src/app", @"src/packages", @"src", + @"vendor/packages", @"vendor", @"static", @"themes", nil]; + NSMutableArray *resourcePaths = [[NSMutableArray alloc] init]; + for (int i = 0; i < paths.count; i++) { + NSString *fullPath = [NSString stringWithFormat:@"%@/%@", _resourcePath, [paths objectAtIndex:i]]; + [resourcePaths addObject:fullPath]; + } + NSString *nodePath = [resourcePaths componentsJoinedByString:@":"]; setenv("NODE_PATH", [nodePath UTF8String], TRUE); if (!background) {