Skip to content

Commit

Permalink
fix: create meta.bash for bin/sub.opt.bash when "one bin/sub enable"
Browse files Browse the repository at this point in the history
  • Loading branch information
adoyle-h committed Sep 20, 2024
1 parent bb8be7c commit 3f73c2d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions one-cmds/bin/enable.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ set_exports() {
done
}

# NOTE: DO NOT modify the value of mod_annotation
readonly mod_annotation='# This file is generated by one.bash. Do not modify the file content.'

cretea_mod_meta() {
local mod_name=$1
local opt_path=$2
local MOD_META="$ONE_DIR/data/$t/$mod_name/meta.bash"
local repo_name
repo_name=$(get_enabled_repo_name "$opt_path")

{
echo "$mod_annotation"
echo "repo_name=$repo_name"
} >"$MOD_META"
}

enable() {
local path=$1
local name=$2
Expand All @@ -44,6 +60,7 @@ enable() {
# Disable first, prevent duplicated module enabled with different priority
disable_mod "$name"
download_mod_data "$name" "$path"
cretea_mod_meta "$name" "$path"

local SCRIPT exports bin_name

Expand Down

0 comments on commit 3f73c2d

Please sign in to comment.