Skip to content

fix: Write aliases to symlink if it exists

Kerri Miller requested to merge github/fork/zemzale/fix-symlink-write into trunk

Created by: zemzale

Description

In cases where aliases.yaml was smylinked to some other place(dotfiles for example), it would remove the smylink and write to a new file.

This commit fixes that by resolving the smylink before writing to the file.

The one thing I thought about is that maybe checking for smylinks in the WriteFile function is not the correct place. Then again if we don't do that there it might come with the problem that we have to check it everywhere before writing and someone in a PR might forget about it.

If there is a better place where this would fit in, feel free to comment on that.

Related Issue

Resolves #892 (closed)

How Has This Been Tested?

Unit tests and local tests:

  • by creating a complete new config
  • by updating existing regular file config
  • by updating a symlinked config

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)

Merge request reports