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

Expose scope's bin directory to action commands #90

Closed noizwaves closed 7 months ago

noizwaves commented 7 months ago

Problem

To better support shared configurations, it would be useful to access the scope configuration directory from within a check or fix command. This would allow for the loading of shared scripts that implement standard library type functionality.

For example, in an application's .scope/bin/some-fix.sh:

. "${SCOPE_BIN_DIR}/../etc/scope/stdlib.sh"

usage "some-fix"
custom_function_2 

Solution

Use std::env::current_exe() to make the bin directory available as SCOPE_BIN_DIR.

TODO