Skip to content
Snippets Groups Projects
Commit 7c69ad61 authored by Nikolaos Kakouros's avatar Nikolaos Kakouros
Browse files

wip

parent dc8b1aa8
Branches
No related tags found
No related merge requests found
...@@ -66,6 +66,8 @@ core_get_installed_version ...@@ -66,6 +66,8 @@ core_get_installed_version
function headstart_bootstrap() { function headstart_bootstrap() {
tmp_dir="${_HEADSTART_SCRIPT_NAME~~}_TMP_DIR" tmp_dir="${_HEADSTART_SCRIPT_NAME~~}_TMP_DIR"
declare -gx _HEADSTART_TMP_DIR="${!tmp_dir}" declare -gx _HEADSTART_TMP_DIR="${!tmp_dir}"
config_dir="${_HEADSTART_SCRIPT_NAME~~}_CONFIG_DIR"
declare -gx _HEADSTART_CONFIG_DIR="${!config_dir}"
declare -gx _HEADSTART_VENDOR_DIR="${_HEADSTART_CORE_DIR}/vendor" declare -gx _HEADSTART_VENDOR_DIR="${_HEADSTART_CORE_DIR}/vendor"
declare -gx HEADSTART_RESOURCES_DIR="${HEADSTART_RESOURCES_DIR-resources}" declare -gx HEADSTART_RESOURCES_DIR="${HEADSTART_RESOURCES_DIR-resources}"
......
...@@ -84,7 +84,21 @@ function show_subcommands() { ...@@ -84,7 +84,21 @@ function show_subcommands() {
@go.show_subcommands || exit @go.show_subcommands || exit
} }
alias __='parse_args_and_options "$@"; __' alias __='parse_args_and_options "$@"; set_plugin_env; __'
function set_plugin_env() {
if [[ "$__go_cmd_path" =~ .+/plugins/.+ ]]; then
go_plugin_name="${__go_cmd_path#$TWMN_COMMANDS_DIR/plugins/}"
go_plugin_name="${go_plugin_name%%/*}"
go_plugin_path="$TWMN_COMMANDS_DIR/plugins/$go_plugin_name"
export go_plugin_name go_plugin_path
if [[ -f "$_HEADSTART_CONFIG_DIR/$go_plugin_name.conf" ]]; then
. "$_HEADSTART_CONFIG_DIR/$go_plugin_name.conf"
fi
fi
}
function parse_args_and_options() { function parse_args_and_options() {
if [[ " $* " == *' --complete '* ]]; then if [[ " $* " == *' --complete '* ]]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment