OSDN Git Service

[fix] : Fixed not being able to get the description of additional channels.
authorhayao <shun819.mail@gmail.com>
Fri, 30 Oct 2020 09:45:54 +0000 (18:45 +0900)
committerhayao <shun819.mail@gmail.com>
Fri, 30 Oct 2020 09:45:54 +0000 (18:45 +0900)
tools/wizard.sh

index 0d40de2..e2f8b44 100755 (executable)
@@ -482,20 +482,16 @@ Function_Global_Ask_kernel () {
 
 # チャンネルの指定
 Function_Global_Ask_channel () {
-    local Var_Local_int Var_Local_count Var_Local_channel Var_Local_channel_list Var_Local_description
-    
-    Var_Local_count=1
-
     # チャンネルの一覧を取得
-    local Var_Local_int Var_Local_count Var_Local_channel Var_Local_channel_list Var_Local_description
+    local Var_Local_int Var_Local_count=1 Var_Local_channel Var_Local_channel_list Var_Local_description Var_Local_channel_dir Var_Local_index
     Var_Local_channel_list=($("${Var_Global_Wizard_Env_script_path}/tools/channel.sh" --nobuiltin show))
+    Var_Local_channel_dir=($("${Var_Global_Wizard_Env_script_path}/tools/channel.sh" --dirname --nobuiltin show))
 
     msg "チャンネルを以下の番号から選択してください。" "Select a channel from the numbers below."
-
     # 選択肢を生成
     for Var_Local_channel in ${Var_Local_channel_list[@]}; do
-        if [[ -f "${Var_Global_Wizard_Env_script_path}/channels/${Var_Local_channel}/description.txt" ]]; then
-            Var_Local_description=$(cat "${Var_Global_Wizard_Env_script_path}/channels/${Var_Local_channel}/description.txt")
+        if [[ -f "${Var_Global_Wizard_Env_script_path}/channels/${Var_Local_channel_dir[$(( Var_Local_count - 1 ))]}/description.txt" ]]; then
+            Var_Local_description=$(cat "${Var_Global_Wizard_Env_script_path}/channels/${Var_Local_channel_dir[$(( Var_Local_count - 1 ))]}/description.txt")
         else
             if [[ "${Var_Global_Wizard_Option_language}"  = "jp" ]]; then
                 Var_Local_description="このチャンネルにはdescription.txtがありません。"