feat: std::mod::get-path

This commit is contained in:
2026-06-02 21:51:52 +02:00
parent b0d7b4d3bf
commit e05ade1a30
+11 -1
View File
@@ -4,7 +4,7 @@ std::bootstrap() {
declare -g STD_VERSION=$1 declare -g STD_VERSION=$1
} }
std::bootstrap 0.1.1 std::bootstrap 0.1.2
INTERPRETER=$(ps -p $$ | awk '$1 != "PID" {print $(NF)}') INTERPRETER=$(ps -p $$ | awk '$1 != "PID" {print $(NF)}')
: "${INTERPRETER:=bash}" : "${INTERPRETER:=bash}"
@@ -93,6 +93,16 @@ std::mod::init() {
std::mod::init std "$STD_VERSION" std::mod::init std "$STD_VERSION"
std::mod::get-path() {
local module_name=${1?Expected a module name}
if [ -n "${std__module_paths[$module_name]}" ]; then
echo "${std__module_paths[$module_name]}"
else
return 1
fi
}
## ##
# Takes a module name and import paths. # Takes a module name and import paths.
# #