diff --git a/setup.sh b/setup.sh index 389f4aeceb634a5981024491d3e2412b2d54ba52..d7c95131693e224e4e3019eb56586c4edbc88671 100644 --- a/setup.sh +++ b/setup.sh @@ -196,7 +196,6 @@ function manage_plugins() { then clear mkdir -p Plugins - cd Plugins echo "Adding/updating plugins..." for i in ${!plugins[@]} @@ -204,7 +203,7 @@ function manage_plugins() { # Check if plugin is already present repo_name_with_extension=${plugin_repositories[$i]##*/} repo_name=${repo_name_with_extension%*.git} - path=$(git config -f ../.gitmodules --get "submodule.Plugins/${repo_name}.path") + path=$(git config -f .gitmodules --get "submodule.Plugins/${repo_name}.path") if [ $? -ne 0 ] then plugin_present=false @@ -218,31 +217,26 @@ function manage_plugins() { then # Plugin was not yet added, call git submodule add echo "Add new plugin: ${plugins[$i]}" - git submodule add -b ${plugin_branches[$i]} ${plugin_repositories[$i]} + cd Plugins + git submodule add -f -b ${plugin_branches[$i]} ${plugin_repositories[$i]} + cd .. else # Updating existing plugin echo "Update plugin: ${plugins[$i]}" - cd $repo_name + cd Plugins/$repo_name git fetch git checkout ${plugin_branches[$i]} git pull - cd .. + cd ../.. fi else if [ "$plugin_present" == true ] then # Remove plugin! - git submodule deinit -f "$repo_name" - git rm -f "$repo_name" - - git config -f ../.gitmodules --remove-section "submodule.Plugins/${repo_name}" - if [ -z "$(cat ../.gitmodules)" ]; then - git rm -f ../.gitmodules - fi + git rm -f "Plugins/$repo_name" fi fi done - cd .. echo "Done, Press enter to continue." read x fi