Cleanup (formatting)
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>
Wed, 19 Oct 2016 09:06:00 +0000 (11:06 +0200)
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>
Wed, 19 Oct 2016 09:06:21 +0000 (11:06 +0200)
bin/linux/restart.py
platform/platform-impl/src/com/intellij/util/Restarter.java

index 5633f1289aff027f71a116085eaf2d499b11fac0..5d49a22c38205d7dab13b21c3ec848dc0cc020c4 100755 (executable)
@@ -17,10 +17,8 @@ while os.getppid() == pid:
     time.sleep(0.5)
 
 if len(sys.argv) > 3:
-    os.spawnv(os.P_WAIT, sys.argv[3], sys.argv[3:])
+    to_launch = sys.argv[3:]
+    os.spawnv(os.P_WAIT, to_launch[0], to_launch)
 
-to_launch = sys.argv[2]
-if sys.platform == 'darwin':
-    os.execv('/usr/bin/open', ['/usr/bin/open', to_launch])
-else:
-    os.execv(to_launch, [to_launch])
+to_launch = ['/usr/bin/open', sys.argv[2]] if sys.platform == 'darwin' else [sys.argv[2]]
+os.execv(to_launch[0], to_launch)
index 69610eb6cbe91d823775acaa794182b7e89f8264..4eb4a60bcbde20bf993b39e09ee26200f66f7472 100644 (file)
@@ -41,11 +41,15 @@ public class Restarter {
 
   public static boolean isSupported() {
     if (SystemInfo.isWindows) {
-      return JnaLoader.isLoaded() && new File(PathManager.getBinPath(), "restarter.exe").exists();
+      return JnaLoader.isLoaded() &&
+             new File(PathManager.getBinPath(), "restarter.exe").exists();
     }
+
     if (SystemInfo.isMac) {
-      return PathManager.getHomePath().contains(".app") && new File(PathManager.getBinPath(), "restarter").canExecute();
+      return PathManager.getHomePath().contains(".app") &&
+             new File(PathManager.getBinPath(), "restarter").canExecute();
     }
+
     if (SystemInfo.isUnix) {
       return JnaLoader.isLoaded() &&
              CreateDesktopEntryAction.getLauncherScript() != null &&