Skip to content

fix(config): resolve symlinks when locating config dir#985

Merged
rsdmike merged 2 commits into
mainfrom
fix/resolve-executable-symlinks
May 18, 2026
Merged

fix(config): resolve symlinks when locating config dir#985
rsdmike merged 2 commits into
mainfrom
fix/resolve-executable-symlinks

Conversation

@rsdmike
Copy link
Copy Markdown
Member

@rsdmike rsdmike commented May 18, 2026

os.Executable() can return a symlink path; using filepath.Dir on it anchors config beside the symlink rather than the real binary. On macOS this surfaces when /usr/local/bin/dmt-console symlinks into /usr/local/device-management-toolkit/console: the app tries to mkdir /usr/local/bin/config and fails with EACCES.

os.Executable() can return a symlink path; using filepath.Dir on it
anchors config beside the symlink rather than the real binary. On
macOS this surfaces when /usr/local/bin/dmt-console symlinks into
/usr/local/device-management-toolkit/console: the app tries to mkdir
/usr/local/bin/config and fails with EACCES.
Copilot AI review requested due to automatic review settings May 18, 2026 20:19
@rsdmike rsdmike enabled auto-merge (squash) May 18, 2026 20:20
Copy link
Copy Markdown

Copilot AI 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 overview

This PR updates default config path resolution so the config directory is anchored next to the real executable when the launched binary path is a symlink.

Changes:

  • Resolves symlinks returned by os.Executable() before deriving the default config path.
  • Falls back to the original executable path if symlink evaluation fails.

Comment thread config/config.go
@rsdmike rsdmike merged commit 3c696e6 into main May 18, 2026
18 checks passed
@rsdmike rsdmike deleted the fix/resolve-executable-symlinks branch May 18, 2026 20:24
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.41%. Comparing base (9d06967) to head (e41b440).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #985   +/-   ##
=======================================
  Coverage   41.40%   41.41%           
=======================================
  Files         134      134           
  Lines       12319    12321    +2     
=======================================
+ Hits         5101     5103    +2     
  Misses       6672     6672           
  Partials      546      546           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RosieAMT
Copy link
Copy Markdown

🎉 This PR is included in version 1.26.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@graikhel-intel graikhel-intel linked an issue May 18, 2026 that may be closed by this pull request
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package Console as an installer

5 participants