(CommandList children: [ (FuncDef name: shim_command body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:plugin_name) op: Equal rhs: {($ VSub_Number "$1")} spids: [9] ) ] spids: [7] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:executable_path) op: Equal rhs: {($ VSub_Number "$2")} spids: [15] ) ] spids: [13] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:plugin_path) op:Equal spids:[21])] spids: [19] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:plugin_path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(get_plugin_path)} {(DQ ($ VSub_Name "$plugin_name"))})] ) left_token: <Left_CommandSub "$("> spids: [25 31] ) } spids: [24] ) ] spids: [24] ) (C {(check_if_plugin_exists)} {(DQ ($ VSub_Name "$plugin_name"))}) (C {(ensure_shims_dir)}) (C {(generate_shim_for_executable)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$executable_path"))} ) ] spids: [4] ) spids: [0 3] ) (FuncDef name: reshim_command body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:plugin_name) op: Equal rhs: {($ VSub_Number "$1")} spids: [67] ) ] spids: [65] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:full_version) op: Equal rhs: {($ VSub_Number "$2")} spids: [73] ) ] spids: [71] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:plugin_path) op:Equal spids:[79])] spids: [77] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:plugin_path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(get_plugin_path)} {(DQ ($ VSub_Name "$plugin_name"))})] ) left_token: <Left_CommandSub "$("> spids: [83 89] ) } spids: [82] ) ] spids: [82] ) (C {(check_if_plugin_exists)} {(DQ ($ VSub_Name "$plugin_name"))}) (C {(ensure_shims_dir)}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$full_version"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (C {(generate_shims_for_version)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$full_version"))} ) ] spids: [-1 120] ) ] else_action: [ (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:plugin_installs_path) op:Equal spids:[147])] spids: [145] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:plugin_installs_path) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(asdf_dir)})]) left_token: <Left_CommandSub "$("> spids: [152 154] ) (/installs/) (${ VSub_Name plugin_name) ) } spids: [150] ) ] spids: [150] ) (ForEach iter_name: install iter_words: [{(DQ (${ VSub_Name plugin_installs_path)) (/) (Lit_Other "*") (/)}] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:full_version_name) op: Equal spids: [184] ) ] spids: [182] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:full_version_name) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(basename)} {(DQ ($ VSub_Name "$install"))}) (C {(sed)} {(SQ <"s/ref\\-/ref\\:/">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [188 202] ) } spids: [187] ) ] spids: [187] ) (C {(generate_shims_for_version)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$full_version_name"))} ) (C {(remove_obsolete_shims)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$full_version_name"))} ) ] spids: [179 227] ) spids: [168 177] ) ] spids: [138 230] ) ] spids: [62] ) spids: [58 61] ) (FuncDef name: ensure_shims_dir body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-d)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(asdf_dir)})]) left_token: <Left_CommandSub "$("> spids: [256 258] ) (/shims) ) } {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (C {(mkdir)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(asdf_dir)})]) left_token: <Left_CommandSub "$("> spids: [271 273] ) (/shims) ) } ) ] spids: [-1 265] ) ] spids: [-1 278] ) ] spids: [240] ) spids: [236 239] ) (FuncDef name: write_shim_script body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:plugin_name) op: Equal rhs: {($ VSub_Number "$1")} spids: [293] ) ] spids: [291] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:version) op: Equal rhs: {($ VSub_Number "$2")} spids: [299] ) ] spids: [297] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:executable_path) op: Equal rhs: {($ VSub_Number "$3")} spids: [305] ) ] spids: [303] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:executable_name) op:Equal spids:[311])] spids: [309] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:executable_name) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(basename)} {(DQ ($ VSub_Name "$executable_path"))})] ) left_token: <Left_CommandSub "$("> spids: [315 321] ) } spids: [314] ) ] spids: [314] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:plugin_shims_path) op:Equal spids:[326])] spids: [324] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:plugin_shims_path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(get_plugin_path)} {(DQ ($ VSub_Name "$plugin_name"))})] ) left_token: <Left_CommandSub "$("> spids: [330 336] ) (/shims) } spids: [329] ) ] spids: [329] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:shim_path) op:Equal spids:[342])] spids: [340] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:shim_path) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(asdf_dir)})]) left_token: <Left_CommandSub "$("> spids: [347 349] ) (/shims/) ($ VSub_Name "$executable_name") ) } spids: [345] ) ] spids: [345] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} { (DQ ($ VSub_Name "$plugin_shims_path") (/) ($ VSub_Name "$executable_name")) } {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (C {(cp)} {(DQ ($ VSub_Name "$plugin_shims_path") (/) ($ VSub_Name "$executable_name"))} {(DQ ($ VSub_Name "$shim_path"))} ) ] spids: [-1 371] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {(DQ ($ VSub_Name "$shim_path"))} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [ {(grep)} {(DQ ("# asdf-plugin-version: ") ($ VSub_Name "$version"))} {(DQ ($ VSub_Name "$shim_path"))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [418] ) ] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (C {(sed)} {(-i) (SQ )} {(-e)} { (DQ (s/) (EscapedLiteralPart token:<Lit_EscapedChar "\\(">) ("asdf-plugin: ") ($ VSub_Name "$plugin_name") (EscapedLiteralPart token:<Lit_EscapedChar "\\)">) (/) (EscapedLiteralPart token: <Lit_EscapedChar "\\1"> ) (EscapedLiteralPart token:<Lit_EscapedChar "\\\\">) ) (SQ <Lit_EscapedChar "\\n">) (DQ ("# asdf-plugin-version: ") ($ VSub_Name "$version") (/)) } {(DQ ($ VSub_Name "$shim_path"))} ) ] spids: [-1 423] ) ] spids: [-1 458] ) ] spids: [387 400] ) ] else_action: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("#!/usr/bin/env bash\n") ("# asdf-plugin: ") (${ VSub_Name plugin_name) ("\n") ("# asdf-plugin-version: ") (${ VSub_Name version) ("\n") ("exec ") (CommandSubPart command_list: (CommandList children:[(C {(asdf_dir)})]) left_token: <Left_CommandSub "$("> spids: [487 489] ) ("/bin/private/asdf-exec ") (${ VSub_Name plugin_name) (" ") (${ VSub_Name executable_path) (" ") (Right_DoubleQuote "\"") (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) ("@") (Right_DoubleQuote "\"") ("\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [466] ) (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$shim_path"))} spids: [469] ) ] ) ] spids: [461 505] ) (C {(chmod)} {(Lit_Other "+") (x)} {(DQ ($ VSub_Name "$shim_path"))}) ] spids: [288] ) spids: [284 287] ) (FuncDef name: generate_shim_for_executable body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:plugin_name) op: Equal rhs: {($ VSub_Number "$1")} spids: [531] ) ] spids: [529] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:executable) op: Equal rhs: {($ VSub_Number "$2")} spids: [537] ) ] spids: [535] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:plugin_path) op:Equal spids:[543])] spids: [541] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:plugin_path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(get_plugin_path)} {(DQ ($ VSub_Name "$plugin_name"))})] ) left_token: <Left_CommandSub "$("> spids: [547 553] ) } spids: [546] ) ] spids: [546] ) (C {(check_if_plugin_exists)} {(DQ ($ VSub_Name "$plugin_name"))}) (SimpleCommand words: [{(read)} {(-r)} {(-a)} {(version_info)}] redirects: [ (Redir op_id: Redir_TLess fd: -1 arg_word: {(DQ ($ VSub_Name "$full_version"))} spids: [578] ) ] more_env: [(env_pair name:IFS val:{(SQ <":">)} spids:[565])] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [590 595] ) ) } {(Lit_Other "=")} {(DQ (ref))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:install_type) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [614 619] ) ) } spids: [612] ) ] spids: [610] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:version) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 1)})) spids: [627 632] ) ) } spids: [625] ) ] spids: [623] ) ] spids: [-1 607] ) ] else_action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:install_type) op: Equal rhs: {(DQ (version))} spids: [641] ) ] spids: [639] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:version) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [651 656] ) ) } spids: [649] ) ] spids: [647] ) ] spids: [636 660] ) (C {(write_shim_script)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$version"))} {(DQ ($ VSub_Name "$executable"))} ) ] spids: [526] ) spids: [522 525] ) (FuncDef name: list_plugin_bin_paths body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:plugin_name) op: Equal rhs: {($ VSub_Number "$1")} spids: [690] ) ] spids: [688] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:version) op: Equal rhs: {($ VSub_Number "$2")} spids: [696] ) ] spids: [694] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:install_type) op: Equal rhs: {($ VSub_Number "$3")} spids: [702] ) ] spids: [700] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:plugin_path) op:Equal spids:[708])] spids: [706] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:plugin_path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(get_plugin_path)} {(DQ ($ VSub_Name "$plugin_name"))})] ) left_token: <Left_CommandSub "$("> spids: [712 718] ) } spids: [711] ) ] spids: [711] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:install_path) op:Equal spids:[723])] spids: [721] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:install_path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(get_install_path)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$install_type"))} {(DQ ($ VSub_Name "$version"))} ) ] ) left_token: <Left_CommandSub "$("> spids: [727 741] ) } spids: [726] ) ] spids: [726] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {(DQ (${ VSub_Name plugin_path) (/bin/list-bin-paths))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:space_separated_list_of_bin_paths) op: Equal spids: [766] ) ] spids: [764] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:space_separated_list_of_bin_paths) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(export)} {(Lit_VarLike "ASDF_INSTALL_TYPE=") ($ VSub_Name "$install_type") } ) (C {(export)} {(Lit_VarLike "ASDF_INSTALL_VERSION=") ($ VSub_Name "$version") } ) (C {(export)} {(Lit_VarLike "ASDF_INSTALL_PATH=") ($ VSub_Name "$install_path") } ) (C {(bash)} {(DQ (${ VSub_Name plugin_path) (/bin/list-bin-paths))} ) ] ) left_token: <Left_CommandSub "$("> spids: [770 801] ) } spids: [769] ) ] spids: [769] ) ] spids: [-1 761] ) ] else_action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:space_separated_list_of_bin_paths) op: Equal rhs: {(DQ (bin))} spids: [809] ) ] spids: [807] ) ] spids: [804 815] ) (C {(echo)} {(DQ ($ VSub_Name "$space_separated_list_of_bin_paths"))}) ] spids: [685] ) spids: [681 684] ) (FuncDef name: generate_shims_for_version body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:plugin_name) op: Equal rhs: {($ VSub_Number "$1")} spids: [837] ) ] spids: [835] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:full_version) op: Equal rhs: {($ VSub_Number "$2")} spids: [843] ) ] spids: [841] ) (C {(check_if_plugin_exists)} {(DQ ($ VSub_Name "$plugin_name"))}) (SimpleCommand words: [{(read)} {(-r)} {(-a)} {(version_info)}] redirects: [ (Redir op_id: Redir_TLess fd: -1 arg_word: {(DQ ($ VSub_Name "$full_version"))} spids: [869] ) ] more_env: [(env_pair name:IFS val:{(SQ <":">)} spids:[856])] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [881 886] ) ) } {(Lit_Other "=")} {(DQ (ref))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:install_type) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [905 910] ) ) } spids: [903] ) ] spids: [901] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:version) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 1)})) spids: [918 923] ) ) } spids: [916] ) ] spids: [914] ) ] spids: [-1 898] ) ] else_action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:install_type) op: Equal rhs: {(DQ (version))} spids: [932] ) ] spids: [930] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:version) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [942 947] ) ) } spids: [940] ) ] spids: [938] ) ] spids: [927 951] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:space_separated_list_of_bin_paths) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(list_plugin_bin_paths)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$version"))} {(DQ ($ VSub_Name "$install_type"))} ) ] ) left_token: <Left_CommandSub "$("> spids: [956 970] ) ) } spids: [954] ) ] spids: [954] ) (SimpleCommand words: [{(read)} {(-r)} {(-a)} {(all_bin_paths)}] redirects: [ (Redir op_id: Redir_TLess fd: -1 arg_word: {(DQ ($ VSub_Name "$space_separated_list_of_bin_paths"))} spids: [987] ) ] more_env: [(env_pair name:IFS val:{(SQ <" ">)} spids:[974])] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:install_path) op:Equal spids:[997])] spids: [995] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:install_path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(get_install_path)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$install_type"))} {(DQ ($ VSub_Name "$version"))} ) ] ) left_token: <Left_CommandSub "$("> spids: [1001 1015] ) } spids: [1000] ) ] spids: [1000] ) (ForEach iter_name: bin_path iter_words: [ { (DQ (BracedVarSub token: <VSub_Name all_bin_paths> bracket_op: (WholeArray op_id:Lit_At) spids: [1026 1031] ) ) } ] do_arg_iter: False body: (DoGroup children: [ (ForEach iter_name: executable_file iter_words: [ {($ VSub_Name "$install_path") (/) ($ VSub_Name "$bin_path") (/) (Lit_Other "*") } ] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:executable_path_relative_to_install_path) op: Equal spids: [1060] ) ] spids: [1058] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:executable_path_relative_to_install_path) op: Equal rhs: {(DQ ($ VSub_Name "$bin_path")) (/) (CommandSubPart command_list: (CommandList children: [ (C {(basename)} {(DQ ($ VSub_Name "$executable_file"))}) ] ) left_token: <Left_CommandSub "$("> spids: [1068 1074] ) } spids: [1063] ) ] spids: [1063] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-x)} {(DQ ($ VSub_Name "$executable_file"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (C {(write_shim_script)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$version"))} {(DQ ($ VSub_Name "$executable_path_relative_to_install_path"))} ) ] spids: [-1 1090] ) ] spids: [-1 1108] ) ] spids: [1051 1111] ) spids: [1043 1049] ) ] spids: [1035 1114] ) spids: [1024 1033] ) ] spids: [832] ) spids: [828 831] ) (FuncDef name: shim_still_exists body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:shim_name) op: Equal rhs: {($ VSub_Number "$1")} spids: [1128] ) ] spids: [1126] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:install_path) op: Equal rhs: {($ VSub_Number "$2")} spids: [1134] ) ] spids: [1132] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:space_separated_list_of_bin_paths) op: Equal rhs: {($ VSub_Number "$3")} spids: [1140] ) ] spids: [1138] ) (SimpleCommand words: [{(read)} {(-r)} {(-a)} {(all_bin_paths)}] redirects: [ (Redir op_id: Redir_TLess fd: -1 arg_word: {(DQ ($ VSub_Name "$space_separated_list_of_bin_paths"))} spids: [1157] ) ] more_env: [(env_pair name:IFS val:{(SQ <" ">)} spids:[1144])] ) (ForEach iter_name: bin_path iter_words: [ { (DQ (BracedVarSub token: <VSub_Name all_bin_paths> bracket_op: (WholeArray op_id:Lit_At) spids: [1173 1178] ) ) } ] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-x)} { (DQ ($ VSub_Name "$install_path") (/) ($ VSub_Name "$bin_path") (/) ($ VSub_Name "$shim_name") ) } {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [(ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] spids: [-1 1202] ) ] spids: [-1 1210] ) ] spids: [1182 1213] ) spids: [1171 1180] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [1123] ) spids: [1119 1122] ) (FuncDef name: remove_obsolete_shims body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:plugin_name) op: Equal rhs: {($ VSub_Number "$1")} spids: [1232] ) ] spids: [1230] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:full_version) op: Equal rhs: {($ VSub_Number "$2")} spids: [1238] ) ] spids: [1236] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:shims_path) op:Equal spids:[1244])] spids: [1242] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:shims_path) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(asdf_dir)})]) left_token: <Left_CommandSub "$("> spids: [1249 1251] ) (/shims) ) } spids: [1247] ) ] spids: [1247] ) (SimpleCommand words: [{(read)} {(-r)} {(-a)} {(version_info)}] redirects: [ (Redir op_id: Redir_TLess fd: -1 arg_word: {(DQ ($ VSub_Name "$full_version"))} spids: [1270] ) ] more_env: [(env_pair name:IFS val:{(SQ <":">)} spids:[1257])] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [1282 1287] ) ) } {(Lit_Other "=")} {(DQ (ref))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:install_type) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [1306 1311] ) ) } spids: [1304] ) ] spids: [1302] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:version) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 1)})) spids: [1319 1324] ) ) } spids: [1317] ) ] spids: [1315] ) ] spids: [-1 1299] ) ] else_action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:install_type) op: Equal rhs: {(DQ (version))} spids: [1333] ) ] spids: [1331] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:version) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [1343 1348] ) ) } spids: [1341] ) ] spids: [1339] ) ] spids: [1328 1352] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:space_separated_list_of_bin_paths) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(list_plugin_bin_paths)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$version"))} {(DQ ($ VSub_Name "$install_type"))} ) ] ) left_token: <Left_CommandSub "$("> spids: [1358 1372] ) ) } spids: [1356] ) ] spids: [1356] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:install_path) op:Equal spids:[1379])] spids: [1377] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:install_path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(get_install_path)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$install_type"))} {(DQ ($ VSub_Name "$version"))} ) ] ) left_token: <Left_CommandSub "$("> spids: [1383 1397] ) } spids: [1382] ) ] spids: [1382] ) (ForEach iter_name: shim_path iter_words: [{(DQ ($ VSub_Name "$shims_path")) (/) (Lit_Other "*")}] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:shim_name) op:Equal spids:[1419])] spids: [1417] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:shim_name) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(basename)} {(DQ ($ VSub_Name "$shim_path"))})] ) left_token: <Left_CommandSub "$("> spids: [1424 1430] ) ) } spids: [1422] ) ] spids: [1422] ) (If arms: [ (if_arm cond: [ (Sentence child: (AndOr children: [ (SimpleCommand words: [ {(grep)} {(DQ ("# asdf-plugin: ") ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$shim_path"))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [1447] ) ] ) (AndOr children: [ (SimpleCommand words: [ {(grep)} { (DQ ("# asdf-plugin-version: ") ($ VSub_Name "$version")) } {(DQ ($ VSub_Name "$shim_path"))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [1466] ) ] ) (Pipeline children: [ (C {(shim_still_exists)} {(DQ ($ VSub_Name "$shim_name"))} {(DQ ($ VSub_Name "$install_path"))} {(DQ ($ VSub_Name "$space_separated_list_of_bin_paths"))} ) ] negated: True ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) terminator: <Op_Semi ";"> ) ] action: [ (C {(remove_shim_for_version)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$shim_name"))} {(DQ ($ VSub_Name "$version"))} ) ] spids: [-1 1491] ) ] spids: [-1 1509] ) ] spids: [1414 1512] ) spids: [1406 1412] ) ] spids: [1227] ) spids: [1223 1226] ) (FuncDef name: remove_shim_for_version body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:plugin_name) op: Equal rhs: {($ VSub_Number "$1")} spids: [1526] ) ] spids: [1524] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:executable_name) op: Equal rhs: {($ VSub_Number "$2")} spids: [1532] ) ] spids: [1530] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:version) op: Equal rhs: {($ VSub_Number "$3")} spids: [1538] ) ] spids: [1536] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:plugin_shims_path) op:Equal spids:[1544])] spids: [1542] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:plugin_shims_path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(get_plugin_path)} {(DQ ($ VSub_Name "$plugin_name"))})] ) left_token: <Left_CommandSub "$("> spids: [1548 1554] ) (/shims) } spids: [1547] ) ] spids: [1547] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:shim_path) op:Equal spids:[1560])] spids: [1558] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:shim_path) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(asdf_dir)})]) left_token: <Left_CommandSub "$("> spids: [1565 1567] ) (/shims/) ($ VSub_Name "$executable_name") ) } spids: [1563] ) ] spids: [1563] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:count_installed) op:Equal spids:[1575])] spids: [1573] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:count_installed) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(list_installed_versions)} {(DQ ($ VSub_Name "$plugin_name"))}) (C {(wc)} {(-l)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [1579 1591] ) } spids: [1578] ) ] spids: [1578] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [ {(grep)} {(DQ ("# asdf-plugin: ") ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$shim_path"))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [1610] ) (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [1614] ) ] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [(ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] spids: [-1 1618] ) ] spids: [-1 1626] ) (C {(sed)} {(-i) (SQ )} {(-e)} {(DQ ("/# asdf-plugin-version: ") ($ VSub_Name "$version") (/d))} {(DQ ($ VSub_Name "$shim_path"))} ) (If arms: [ (if_arm cond: [ (Sentence child: (AndOr children: [ (C {(Lit_Other "[")} {(KW_Bang "!")} {(-f)} { (DQ ($ VSub_Name "$plugin_shims_path") (/) ($ VSub_Name "$executable_name") ) } {(Lit_Other "]")} ) (AndOr children: [ (Pipeline children: [ (SimpleCommand words: [ {(grep)} {(DQ ("# asdf-plugin-version"))} {(DQ ($ VSub_Name "$shim_path"))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [1682] ) ] ) ] negated: True ) (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$count_installed"))} {(-eq)} {(0)} {(Lit_Other "]")} ) ] op_id: Op_DPipe ) ] op_id: Op_DAmp ) terminator: <Op_Semi ";"> ) ] action: [(C {(rm)} {(DQ ($ VSub_Name "$shim_path"))})] spids: [-1 1703] ) ] spids: [-1 1713] ) ] spids: [1521] ) spids: [1517 1520] ) (FuncDef name: remove_shims_for_version body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:plugin_name) op: Equal rhs: {($ VSub_Number "$1")} spids: [1727] ) ] spids: [1725] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:full_version) op: Equal rhs: {($ VSub_Number "$2")} spids: [1733] ) ] spids: [1731] ) (C {(check_if_plugin_exists)} {(DQ ($ VSub_Name "$plugin_name"))}) (SimpleCommand words: [{(read)} {(-r)} {(-a)} {(version_info)}] redirects: [ (Redir op_id: Redir_TLess fd: -1 arg_word: {(DQ ($ VSub_Name "$full_version"))} spids: [1758] ) ] more_env: [(env_pair name:IFS val:{(SQ <":">)} spids:[1745])] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [1770 1775] ) ) } {(Lit_Other "=")} {(DQ (ref))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:install_type) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [1794 1799] ) ) } spids: [1792] ) ] spids: [1790] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:version) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 1)})) spids: [1807 1812] ) ) } spids: [1805] ) ] spids: [1803] ) ] spids: [-1 1787] ) ] else_action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:install_type) op: Equal rhs: {(DQ (version))} spids: [1821] ) ] spids: [1819] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:version) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name version_info> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [1831 1836] ) ) } spids: [1829] ) ] spids: [1827] ) ] spids: [1816 1840] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:space_separated_list_of_bin_paths) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(list_plugin_bin_paths)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$version"))} {(DQ ($ VSub_Name "$install_type"))} ) ] ) left_token: <Left_CommandSub "$("> spids: [1845 1859] ) ) } spids: [1843] ) ] spids: [1843] ) (SimpleCommand words: [{(read)} {(-r)} {(-a)} {(all_bin_paths)}] redirects: [ (Redir op_id: Redir_TLess fd: -1 arg_word: {(DQ ($ VSub_Name "$space_separated_list_of_bin_paths"))} spids: [1876] ) ] more_env: [(env_pair name:IFS val:{(SQ <" ">)} spids:[1863])] ) (ForEach iter_name: bin_path iter_words: [ { (DQ (BracedVarSub token: <VSub_Name all_bin_paths> bracket_op: (WholeArray op_id:Lit_At) spids: [1891 1896] ) ) } ] do_arg_iter: False body: (DoGroup children: [ (ForEach iter_name: executable_file iter_words: [ {($ VSub_Name "$install_path") (/) ($ VSub_Name "$bin_path") (/) (Lit_Other "*") } ] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:executable_name) op: Equal spids: [1921] ) ] spids: [1919] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:executable_name) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(basename)} {(DQ ($ VSub_Name "$executable_file"))}) ] ) left_token: <Left_CommandSub "$("> spids: [1926 1932] ) ) } spids: [1924] ) ] spids: [1924] ) (C {(remove_shim_for_version)} {(DQ ($ VSub_Name "$plugin_name"))} {(DQ ($ VSub_Name "$executable_name"))} {(DQ ($ VSub_Name "$version"))} ) ] spids: [1916 1951] ) spids: [1908 1914] ) ] spids: [1900 1954] ) spids: [1889 1898] ) ] spids: [1722] ) spids: [1718 1721] ) ] )