Skip to content

Conversation

@RohitKushvaha01
Copy link
Member

No description provided.

@github-actions
Copy link

github-actions bot commented Oct 22, 2025

PR Summary

Updated the sourcing mechanism for the utils script across various shell scripts, including init.sh, setup.sh, universal_runner.sh, and all Language Server Protocol (LSP) related scripts. Previously, utils was sourced using relative paths like $(dirname "$0")/utils or $(dirname "$0")/../utils. This change standardizes the sourcing to use the absolute path $PREFIX/local/bin/utils, ensuring consistent access to the utility functions regardless of the script's execution context.

Changes

File Summary
core/main/src/main/assets/terminal/init.sh Updated the init.sh script to source the utils file using the absolute path $PREFIX/local/bin/utils instead of the previous relative path $(dirname "$0")/utils.
core/main/src/main/assets/terminal/lsp/bash.sh Modified the bash.sh LSP script to source the utils file using the absolute path $PREFIX/local/bin/utils instead of the previous relative path $(dirname "$0")/../utils.
core/main/src/main/assets/terminal/lsp/css.sh Modified the css.sh LSP script to source the utils file using the absolute path $PREFIX/local/bin/utils instead of the previous relative path $(dirname "$0")/../utils.
core/main/src/main/assets/terminal/lsp/eslint.sh Modified the eslint.sh LSP script to source the utils file using the absolute path $PREFIX/local/bin/utils instead of the previous relative path $(dirname "$0")/../utils.
core/main/src/main/assets/terminal/lsp/html.sh Modified the html.sh LSP script to source the utils file using the absolute path $PREFIX/local/bin/utils instead of the previous relative path $(dirname "$0")/../utils.
core/main/src/main/assets/terminal/lsp/json.sh Modified the json.sh LSP script to source the utils file using the absolute path $PREFIX/local/bin/utils instead of the previous relative path $(dirname "$0")/../utils.
core/main/src/main/assets/terminal/lsp/markdown.sh Modified the markdown.sh LSP script to source the utils file using the absolute path $PREFIX/local/bin/utils instead of the previous relative path $(dirname "$0")/../utils.
core/main/src/main/assets/terminal/lsp/python.sh Modified the python.sh LSP script to source the utils file using the absolute path $PREFIX/local/bin/utils instead of the previous relative path $(dirname "$0")/../utils.
core/main/src/main/assets/terminal/lsp/typescript.sh Modified the typescript.sh LSP script to source the utils file using the absolute path $PREFIX/local/bin/utils instead of the previous relative path $(dirname "$0")/../utils.
core/main/src/main/assets/terminal/setup.sh Updated the setup.sh script to source the utils file using the absolute path $PREFIX/local/bin/utils instead of the previous relative path $(dirname "$0")/utils.
core/main/src/main/assets/terminal/universal_runner.sh Updated the universal_runner.sh script to source the utils file using the absolute path $PREFIX/local/bin/utils instead of the previous relative path $(dirname "$0")/utils.

autogenerated by presubmit.ai

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Pull request needs attention.

Review Summary

Commits Considered (11)
Files Processed (11)
  • core/main/src/main/assets/terminal/init.sh (1 hunk)
  • core/main/src/main/assets/terminal/lsp/bash.sh (1 hunk)
  • core/main/src/main/assets/terminal/lsp/css.sh (1 hunk)
  • core/main/src/main/assets/terminal/lsp/eslint.sh (1 hunk)
  • core/main/src/main/assets/terminal/lsp/html.sh (1 hunk)
  • core/main/src/main/assets/terminal/lsp/json.sh (1 hunk)
  • core/main/src/main/assets/terminal/lsp/markdown.sh (1 hunk)
  • core/main/src/main/assets/terminal/lsp/python.sh (1 hunk)
  • core/main/src/main/assets/terminal/lsp/typescript.sh (1 hunk)
  • core/main/src/main/assets/terminal/setup.sh (1 hunk)
  • core/main/src/main/assets/terminal/universal_runner.sh (1 hunk)
Actionable Comments (2)
  • core/main/src/main/assets/terminal/init.sh [5-5]

    possible bug: "Validate the $PREFIX environment variable before use."

  • core/main/src/main/assets/terminal/init.sh [5-5]

    possible bug: "Verify existence of the utility script before sourcing."

Skipped Comments (0)

shopt -s checkwinsize

source "$(dirname "$0")/utils"
source "$PREFIX/local/bin/utils"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script now relies on the $PREFIX environment variable. It's crucial to ensure that $PREFIX is always set correctly before this line. Consider adding a check like if [ -z "$PREFIX" ]; then echo "Error: PREFIX is not set. Cannot source utils script."; exit 1; fi before attempting to source the utils script to prevent runtime errors if the variable is missing or empty. This is especially important in init.sh as it does not have set -e at the top, meaning a failed source might not immediately stop execution.

shopt -s checkwinsize

source "$(dirname "$0")/utils"
source "$PREFIX/local/bin/utils"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After ensuring $PREFIX is set, it's also a good practice to verify that the utils file actually exists at the specified absolute path ($PREFIX/local/bin/utils). If the file is missing, the source command will fail. Adding a check like if [ ! -f "$PREFIX/local/bin/utils" ]; then echo "Error: utils script not found at $PREFIX/local/bin/utils."; exit 1; fi would make the script more robust and provide a clearer error message. This applies to all scripts where the sourcing mechanism was changed.

@RohitKushvaha01 RohitKushvaha01 merged commit 67b3732 into main Oct 22, 2025
@RohitKushvaha01 RohitKushvaha01 deleted the RohitKushvaha01-patch-1 branch October 22, 2025 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants