From a094a54ac75c67be02a09992318d7c1ea094f569 Mon Sep 17 00:00:00 2001 From: Deepak Bhatt Date: Fri, 3 Jan 2025 05:31:22 +0000 Subject: [PATCH] feat: [CDE-576]: fix intellij support (#3222) * feat: [CDE-576]: fix debian warning * feat: [CDE-576]: fix intellij support --- app/gitspace/orchestrator/ide/intellij.go | 4 ++-- .../orchestrator/utils/script_templates/install_git.sh | 2 +- .../utils/script_templates/install_tools_intellij.sh | 2 +- .../orchestrator/utils/script_templates/setup_intellij.sh | 4 ++-- .../orchestrator/utils/script_templates/setup_ssh_server.sh | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/gitspace/orchestrator/ide/intellij.go b/app/gitspace/orchestrator/ide/intellij.go index e8e974573..7713affed 100644 --- a/app/gitspace/orchestrator/ide/intellij.go +++ b/app/gitspace/orchestrator/ide/intellij.go @@ -132,7 +132,7 @@ func (ij *Intellij) setupIntellijIDE( } err = exec.ExecuteCommandInHomeDirAndLog(ctx, intellijIDEScript, - true, gitspaceLogger, true) + false, gitspaceLogger, true) if err != nil { return fmt.Errorf("failed to setup intellij IDE: %w", err) } @@ -218,7 +218,7 @@ func (ij *Intellij) runRemoteIDE( "failed to generate scipt to run intelliJ IDE from template %s: %w", templateRunSSHServer, err) } - err = exec.ExecuteCommandInHomeDirAndLog(ctx, runSSHScript, true, gitspaceLogger, true) + err = exec.ExecuteCommandInHomeDirAndLog(ctx, runSSHScript, false, gitspaceLogger, true) if err != nil { return fmt.Errorf("failed to run intelliJ IDE: %w", err) } diff --git a/app/gitspace/orchestrator/utils/script_templates/install_git.sh b/app/gitspace/orchestrator/utils/script_templates/install_git.sh index c47ba207a..dd472016f 100644 --- a/app/gitspace/orchestrator/utils/script_templates/install_git.sh +++ b/app/gitspace/orchestrator/utils/script_templates/install_git.sh @@ -11,7 +11,7 @@ install_git() { echo "Git is not installed. Installing Git..." case "$(distro)" in debian) - apt-get update && apt-get install -y git + export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -y git ;; fedora) dnf install -y git diff --git a/app/gitspace/orchestrator/utils/script_templates/install_tools_intellij.sh b/app/gitspace/orchestrator/utils/script_templates/install_tools_intellij.sh index d5ce272db..904d3635d 100644 --- a/app/gitspace/orchestrator/utils/script_templates/install_tools_intellij.sh +++ b/app/gitspace/orchestrator/utils/script_templates/install_tools_intellij.sh @@ -19,7 +19,7 @@ install_tool() { case "$os_dist" in debian|ubuntu) - DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y "$tool" + export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -y "$tool" ;; fedora) dnf install -y "$tool" diff --git a/app/gitspace/orchestrator/utils/script_templates/setup_intellij.sh b/app/gitspace/orchestrator/utils/script_templates/setup_intellij.sh index 1839670f6..987954ba3 100644 --- a/app/gitspace/orchestrator/utils/script_templates/setup_intellij.sh +++ b/app/gitspace/orchestrator/utils/script_templates/setup_intellij.sh @@ -58,8 +58,8 @@ EXTRACTED_DIRNAME=$(basename "$(find "$INTELLIJ_PATH" -maxdepth 1 -type d)") mv "$INTELLIJ_PATH/$EXTRACTED_DIRNAME/"* "$INTELLIJ_PATH" rm -r "$INTELLIJ_PATH/$EXTRACTED_DIRNAME" -if [ -d "$INTELLIJ_PATH" ]; then - chown -R "$username:$username" "$INTELLIJ_PATH" +if [ -d "$USER_HOME" ]; then + chown -R "$username:$username" "$USER_HOME" fi # Cleanup diff --git a/app/gitspace/orchestrator/utils/script_templates/setup_ssh_server.sh b/app/gitspace/orchestrator/utils/script_templates/setup_ssh_server.sh index 2489f3867..c07c5e236 100644 --- a/app/gitspace/orchestrator/utils/script_templates/setup_ssh_server.sh +++ b/app/gitspace/orchestrator/utils/script_templates/setup_ssh_server.sh @@ -10,8 +10,8 @@ if ! command -v sshd >/dev/null 2>&1; then case "$(distro)" in debian) - apt-get update - apt-get install -y openssh-server + export DEBIAN_FRONTEND=noninteractive && apt-get update + export DEBIAN_FRONTEND=noninteractive && apt-get install -y openssh-server ;; fedora) dnf install -y openssh-server