mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Add all resource paths to NODE_PATH env var
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user