feat: std::mod::get-path
This commit is contained in:
+11
-1
@@ -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.
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user