diff --git a/abra b/abra index 2eb5884..606b923 100755 --- a/abra +++ b/abra @@ -510,18 +510,20 @@ require_plugin() { warning "The $PLUGIN plugin was not found, fetching via Git" + mkdir -p "$ABRA_DIR/plugins" + if [[ "$BRANCH" != "master" ]]; then git_extra_args="--branch $BRANCH" fi # shellcheck disable=SC2086 - if ! git clone ${git_extra_args:-} "$GIT_URL/$APP.git" "$ABRA_DIR/apps/$APP" > /dev/null 2>&1 ; then + if ! git clone ${git_extra_args:-} "$GIT_URL/$PLUGIN.git" "$ABRA_DIR/plugins/$PLUGIN" > /dev/null 2>&1 ; then error "Could not retrieve the $PLUGIN plugin, does it exist?" fi - if [[ $(cd "$ABRA_DIR/apps/$APP" && git branch --list | wc -l) == "0" ]]; then + if [[ $(cd "$ABRA_DIR/plugins/$PLUGIN" && git branch --list | wc -l) == "0" ]]; then debug "Failed to clone default branch, guessing alternative is 'main'" - (cd "$ABRA_DIR/apps/$APP" && git checkout main > /dev/null 2>&1) + (cd "$ABRA_DIR/plugins/$PLUGIN" && git checkout main > /dev/null 2>&1) fi success "Fetched the $PLUGIN plugin via Git"