Use isDevMode method to determine whether to use bundle resource path

This commit is contained in:
Nathan Sobo
2013-04-09 16:02:40 -06:00
committed by Corey Johnson & Kevin Sawicki
parent 9d2d3d5c00
commit df064ddd21
2 changed files with 4 additions and 8 deletions

View File

@@ -31,6 +31,7 @@ class AtomCefClient;
- (id)initSpecsThenExit:(BOOL)exitWhenDone;
- (id)initBenchmarksThenExit:(BOOL)exitWhenDone;
- (void)setPidToKillOnClose:(NSNumber *)pid;
- (BOOL)isDevMode;
- (void)toggleDevTools;
- (void)showDevTools;

View File

@@ -103,9 +103,7 @@
- (id)initWithPath:(NSString *)path {
_pathToOpen = [path retain];
AtomApplication *atomApplication = (AtomApplication *)[AtomApplication sharedApplication];
BOOL useBundleResourcePath = [atomApplication.arguments objectForKey:@"dev"] == nil;
return [self initWithBootstrapScript:@"window-bootstrap" background:NO useBundleResourcePath:useBundleResourcePath];
return [self initWithBootstrapScript:@"window-bootstrap" background:NO useBundleResourcePath:![self isDevMode]];
}
- (id)initDevWithPath:(NSString *)path {
@@ -114,10 +112,7 @@
}
- (id)initInBackground {
AtomApplication *atomApplication = (AtomApplication *)[AtomApplication sharedApplication];
BOOL useBundleResourcePath = [atomApplication.arguments objectForKey:@"dev"] == nil;
[self initWithBootstrapScript:@"window-bootstrap" background:YES useBundleResourcePath:useBundleResourcePath];
[self initWithBootstrapScript:@"window-bootstrap" background:YES useBundleResourcePath:![self isDevMode]];
[self.window setFrame:NSMakeRect(0, 0, 0, 0) display:NO];
[self.window setExcludedFromWindowsMenu:YES];
[self.window setCollectionBehavior:NSWindowCollectionBehaviorStationary];
@@ -271,7 +266,7 @@
[_devButton setHidden:NO];
}
- (bool)isDevMode {
- (BOOL)isDevMode {
NSString *bundleResourcePath = [[NSBundle bundleForClass:self.class] resourcePath];
return ![_resourcePath isEqualToString:bundleResourcePath];
}