Skip to content

Allow symlinks to phoebus.sh#3845

Merged
shroffk merged 2 commits into
ControlSystemStudio:masterfrom
krisztianloki:Allow-symlinks-to-phoebus.sh
Jun 22, 2026
Merged

Allow symlinks to phoebus.sh#3845
shroffk merged 2 commits into
ControlSystemStudio:masterfrom
krisztianloki:Allow-symlinks-to-phoebus.sh

Conversation

@krisztianloki

Copy link
Copy Markdown
Contributor

Starting Phoebus using a symlink to phoebus.sh is not possible because the detection where Phoebus was installed fails which means the .jar cannot be found.

This PR uses realpath instead of the cd and pwd -P pair to resolve symlinks and convert the path to absolute.

There is another problem if the installation path contains spaces; we need to put ${TOP} inside quotes.

Checklist

  • Testing:
    • The feature has automated tests
    • Tests were run
    • Used phoebus.sh to check if it works for symlinks and paths containing spaces
  • Documentation:
    • The feature is documented
    • The documentation is up to date
    • Release notes:
      • Added an entry if the change is breaking or significant
      • Added an entry when adding a new feature

Use realpath to resolve symbolic links to determine where TOP is
Needed if the path contains spaces
@shroffk shroffk requested review from Copilot, kasemir and shroffk June 22, 2026 13:42
@shroffk shroffk merged commit b95899e into ControlSystemStudio:master Jun 22, 2026
4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the phoebus.sh launcher to correctly resolve the installation directory when the script is invoked via a symlink, and to improve behavior when the installation path contains spaces.

Changes:

  • Resolve the script path via realpath and derive TOP from it (to support symlink-based launches).
  • Quote ${TOP} in cd and quote the computed JAR path when invoking java.
  • Quote the ${TOP} prefix used for the product-*.jar lookup to better support paths with spaces.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +8 to +9
realpath=$(realpath "$0")
TOP=$(dirname "$realpath")
then
echo "Installing update..."
cd ${TOP}
cd "${TOP}"


JAR=`echo ${TOP}/product-*.jar`
JAR=`echo "${TOP}"/product-*.jar`
@sonarqubecloud

Copy link
Copy Markdown

@krisztianloki krisztianloki deleted the Allow-symlinks-to-phoebus.sh branch June 22, 2026 18:31
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.

3 participants