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

Load "shared" config files relative to executable #75

Closed noizwaves closed 7 months ago

noizwaves commented 7 months ago

Following on https://github.com/ethankhall/scope/discussions/74, this PR updates scope to also search for config files relative to it's current executable path.

Testing

I was able to verify this change manually with a debug build locally.

Shared config is present

❯ tree ~/workspace/gusto_scope_config
/Users/adam.neumann/workspace/gusto_scope_config
├── bin
│   └── scope
└── etc
    └── scope
        └── homebrew.yaml

❯ ~/workspace/gusto_scope_config/bin/scope doctor list
 INFO Available checks that will run
 INFO   Name                       Description                                                 Path
 INFO - ScopeDoctorGroup/homebrew  Homebrew                                                    ../gusto_scope_config/bin/../etc/scope/homebrew.yaml

Shared config is missing

/Users/adam.neumann/workspace/gusto_scope_config
├── bin
│   └── scope
└── etc

❯ ~/workspace/gusto_scope_config/bin/scope doctor list
 INFO Available checks that will run
 INFO   Name                  Description                                                 Path
noizwaves commented 7 months ago

We should update the "file location" to canonicalize the path, to remove the extra ../

I noticed that as well, I can circle back with that improvement 👍