oscope-dev / scope

Scoping user machines
https://oscope-dev.github.io/scope/
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

Canonicalize shared config paths #92

Closed noizwaves closed 7 months ago

noizwaves commented 7 months ago

Problem

When shared configs were being loaded, their paths were being shown including the bin/../etc string, which is unnecessary:

❯ scope doctor list
 INFO Available checks that will run
 INFO   Name                                          Description                                                 Path
 INFO - ScopeDoctorGroup/homebrew                     Homebrew                                                    ../gusto_scope/bin/../etc/scope/shared/environment/homebrew.yaml
 INFO - ScopeDoctorGroup/app                          Application setup                                           .scope/app.yaml

Solution

Canonicalize the shared path before searching it for files. Now:

❯ scope doctor list
 INFO Available checks that will run
 INFO   Name                                          Description                                                 Path
 INFO - ScopeDoctorGroup/homebrew                     Homebrew                                                    ../gusto_scope/etc/scope/shared/environment/homebrew.yaml
 INFO - ScopeDoctorGroup/app                          Application setup                                           .scope/app.yaml