diff --git a/Rakefile b/Rakefile index 67646bfbc..f7d45a3a6 100644 --- a/Rakefile +++ b/Rakefile @@ -37,11 +37,7 @@ task :install => :build do # Install cli atom usr_bin_path = default_usr_bin_path = "/opt/github/bin" cli_path = "#{usr_bin_path}/atom" - unless File.exists?(cli_path) - print "Where do you want the cli binary insalled (#{default_usr_bin_path}): " - usr_bin_path = $stdin.gets.strip - usr_bin_path = default_usr_bin_path if usr_bin_path.empty? - end + stable_cli_path = "#{usr_bin_path}/atom-stable" if !File.exists?(usr_bin_path) $stderr.puts "ERROR: Failed to install atom cli tool at '#{usr_bin_path}'" @@ -49,6 +45,7 @@ task :install => :build do end `echo '#!/bin/sh\nopen #{dest} -n --args --resource-path="#{ATOM_SRC_PATH}" --executed-from="$(pwd)" $@' > #{cli_path} && chmod 755 #{cli_path}` + `echo '#!/bin/sh\nopen #{dest} -n --args --resource-path="#{ATOM_SRC_PATH}" --executed-from="$(pwd)" --stable $@' > #{stable_cli_path} && chmod 755 #{stable_cli_path}` Rake::Task["create-dot-atom"].invoke() Rake::Task["clone-default-bundles"].invoke() diff --git a/native/atom_application.mm b/native/atom_application.mm index a081fd726..6a972549c 100644 --- a/native/atom_application.mm +++ b/native/atom_application.mm @@ -48,20 +48,22 @@ static struct option longopts[] = { { "executed-from", optional_argument, NULL, 'K' }, - { "resource-path", optional_argument, NULL, 'r' }, - { "benchmark", optional_argument, NULL, 'b' }, - { "test", optional_argument, NULL, 't' }, + { "resource-path", optional_argument, NULL, 'R' }, + { "benchmark", optional_argument, NULL, 'B' }, + { "test", optional_argument, NULL, 'T' }, + { "stable", no_argument, NULL, 'S' }, { "noop", optional_argument, NULL, NULL }, { NULL, 0, NULL, 0 } }; - while ((opt = getopt_long(argc, cleanArgv, "r:K:bth?", longopts, &longindex)) != -1) { + while ((opt = getopt_long(argc, cleanArgv, "R:K:BTSh?", longopts, &longindex)) != -1) { NSString *key, *value; switch (opt) { case 'K': - case 'r': - case 'b': - case 't': + case 'R': + case 'B': + case 'T': + case 'S': key = [NSString stringWithUTF8String:longopts[longindex].name]; value = optarg ? [NSString stringWithUTF8String:optarg] : @"YES"; [arguments setObject:value forKey:key]; diff --git a/native/atom_window_controller.mm b/native/atom_window_controller.mm index 01973f198..8f9e45e44 100644 --- a/native/atom_window_controller.mm +++ b/native/atom_window_controller.mm @@ -20,14 +20,16 @@ [super dealloc]; } -- (id)initWithBootstrapScript:(NSString *)bootstrapScript background:(BOOL)background { +- (id)initWithBootstrapScript:(NSString *)bootstrapScript background:(BOOL)background alwaysUseBundleResourcePath:(BOOL)alwaysUseBundleResourcePath { self = [super initWithWindowNibName:@"AtomWindow"]; _bootstrapScript = [bootstrapScript retain]; AtomApplication *atomApplication = (AtomApplication *)[AtomApplication sharedApplication]; - _resourcePath = [[atomApplication.arguments objectForKey:@"resource-path"] retain]; - if (!_resourcePath) _resourcePath = [[[NSBundle mainBundle] resourcePath] retain]; + _resourcePath = [atomApplication.arguments objectForKey:@"resource-path"]; + if (alwaysUseBundleResourcePath || !_resourcePath) { + _resourcePath = [[[NSBundle mainBundle] resourcePath] retain]; + } if (!background) { [self setShouldCascadeWindows:NO]; @@ -40,11 +42,16 @@ - (id)initWithPath:(NSString *)path { _pathToOpen = [path retain]; - return [self initWithBootstrapScript:@"window-bootstrap" background:NO]; + AtomApplication *atomApplication = (AtomApplication *)[AtomApplication sharedApplication]; + BOOL stable = [atomApplication.arguments objectForKey:@"stable"] != nil; + return [self initWithBootstrapScript:@"window-bootstrap" background:NO alwaysUseBundleResourcePath:stable]; } - (id)initInBackground { - [self initWithBootstrapScript:@"window-bootstrap" background:YES]; + AtomApplication *atomApplication = (AtomApplication *)[AtomApplication sharedApplication]; + BOOL stable = [atomApplication.arguments objectForKey:@"stable"] != nil; + + [self initWithBootstrapScript:@"window-bootstrap" background:YES alwaysUseBundleResourcePath:stable]; [self.window setFrame:NSMakeRect(0, 0, 0, 0) display:NO]; [self.window setExcludedFromWindowsMenu:YES]; return self; @@ -53,13 +60,13 @@ - (id)initSpecsThenExit:(BOOL)exitWhenDone { _runningSpecs = true; _exitWhenDone = exitWhenDone; - return [self initWithBootstrapScript:@"spec-bootstrap" background:NO]; + return [self initWithBootstrapScript:@"spec-bootstrap" background:NO alwaysUseBundleResourcePath:NO]; } - (id)initBenchmarksThenExit:(BOOL)exitWhenDone { _runningSpecs = true; _exitWhenDone = exitWhenDone; - return [self initWithBootstrapScript:@"benchmark-bootstrap" background:NO]; + return [self initWithBootstrapScript:@"benchmark-bootstrap" background:NO alwaysUseBundleResourcePath:NO]; } - (void)addBrowserToView:(NSView *)view url:(const char *)url cefHandler:(CefRefPtr)cefClient {