Repository: ballerina-platform/ballerina-distribution
Issue: Language server launcher scripts does not have executable permission when pulling the distribution using the updater tool

**Description:**
Please note $title for jballerina-1.1.0-beta distribution, which affects the IntelliJ plugin and ends up as a language server initialization failure.

**Suggested Labels:**
<!-- Optional comma separated list of suggested labels. Non committers can’t assign labels to issues, so this will help issue creators who are not a committer to suggest possible labels-->

**Suggested Assignees:**
<!--Optional comma separated list of suggested team members who should attend the issue. Non committers can’t assign issues to assignees, so this will help issue creators who are not a committer to suggest possible assignees-->

**Affected Product Version:**

- OS  - Ubuntu 18.04.3 LTS

- Ballerina version
  - jBallerina 1.1.0-beta
  - Language specification 2019R3
  - Command 1.1.0-alpha

**OS, DB, other environment details and versions:**    

**Steps to reproduce:**


**Related Issues:**
<!-- Any related issues such as sub tasks, issues reported in other repositories (e.g component repositories), similar problems, etc. -->

Changed files:
ballerina-command/src/main/java/org/ballerinalang/command/util/ToolUtil.java, ballerina-command/src/main/java/org/ballerinalang/command/util/OSUtils.java

diff --git a/ballerina-command/src/main/java/org/ballerinalang/command/util/OSUtils.java b/ballerina-command/src/main/java/org/ballerinalang/command/util/OSUtils.java
index cb69e524f..11042ee6b 100644
--- a/ballerina-command/src/main/java/org/ballerinalang/command/util/OSUtils.java
+++ b/ballerina-command/src/main/java/org/ballerinalang/command/util/OSUtils.java
@@ -57,14 +57,7 @@ public class OSUtils {
      * @return name of the file
      */
     public static String getExecutableFileName() {
-        if (OSUtils.isWindows()) {
-            return "ballerina.bat";
-        } else if (OSUtils.isUnix() || OSUtils.isSolaris()) {
-            return "ballerina";
-        } else if (OSUtils.isMac()) {
-            return "ballerina";
-        }
-        return null;
+        return OSUtils.isWindows() ? "ballerina.bat" : "ballerina";
     }
 
     /**
@@ -72,14 +65,23 @@ public class OSUtils {
      * @return name of the file
      */
     public static String getInstallScriptFileName() {
-        if (OSUtils.isWindows()) {
-            return "install.bat";
-        } else if (OSUtils.isUnix() || OSUtils.isSolaris()) {
-            return "install";
-        } else if (OSUtils.isMac()) {
-            return "install";
-        }
-        return null;
+        return OSUtils.isWindows() ? "install.bat" : "install";
+    }
+
+    /**
+     * Provide file name of debug adapter script for current operating system.
+     * @return name of the file
+     */
+    public static String getDebugAdapterName() {
+        return OSUtils.isWindows() ? "debug-adapter-launcher.bat" : "debug-adapter-launcher.sh";
+    }
+
+    /**
+     * Provide file name of language server launcher script for current operating system.
+     * @return name of the file
+     */
+    public static String getLangServerLauncherName() {
+        return OSUtils.isWindows() ? "language-server-launcher.bat" : "language-server-launcher.sh";
     }
 
     public static String getBallerinaVersionFilePath() throws IOException {
diff --git a/ballerina-command/src/main/java/org/ballerinalang/command/util/ToolUtil.java b/ballerina-command/src/main/java/org/ballerinalang/command/util/ToolUtil.java
index 3dedd5521..b84143acd 100644
--- a/ballerina-command/src/main/java/org/ballerinalang/command/util/ToolUtil.java
+++ b/ballerina-command/src/main/java/org/ballerinalang/command/util/ToolUtil.java
@@ -385,6 +385,23 @@ public class ToolUtil {
             addExecutablePermissionToFile(new File(distPath + File.separator + distribution
                                                            + File.separator + "bin"
                                                            + File.separator + OSUtils.getExecutableFileName()));
+
+
+            String langServerPath = distPath + File.separator + distribution + File.separator + "lib"
+                                    + File.separator + "tools";
+            File launcherServer = new File(langServerPath + File.separator + "lang-server"
+                    + File.separator + "launcher" + File.separator + OSUtils.getLangServerLauncherName());
+            File debugAdpater = new File(langServerPath + File.separator + "debug-adapter"
+                    + File.separator + "launcher" + File.separator + OSUtils.getDebugAdapterName());
+
+            if (debugAdpater.exists()) {
+                addExecutablePermissionToFile(debugAdpater);
+            }
+
+            if (launcherServer.exists()) {
+                addExecutablePermissionToFile(launcherServer);
+            }
+
             new File(zipFileLocation).delete();
         } finally {
             conn.disconnect();