fix: rename internal plugin repository functions (#1537)

This commit is contained in:
James Hegedus 2023-04-12 13:01:32 +10:00 committed by GitHub
parent 491ef2a9f2
commit 5367f1f090
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View File

@ -1,7 +1,7 @@
# -*- sh -*-
plugin_list_all_command() {
initialize_or_update_repository
initialize_or_update_plugin_repository
local plugins_index_path
plugins_index_path="$(asdf_data_dir)/repository/plugins"

View File

@ -63,7 +63,7 @@ plugin_add_command() {
if [ -n "$2" ]; then
local source_url=$2
else
initialize_or_update_repository
initialize_or_update_plugin_repository
local source_url
source_url=$(get_plugin_source_url "$plugin_name")
fi

View File

@ -50,7 +50,7 @@ asdf_dir() {
fi
}
asdf_repository_url() {
asdf_plugin_repository_url() {
printf "https://github.com/asdf-vm/asdf-plugins.git\n"
}
@ -418,7 +418,7 @@ repository_needs_update() {
[ "$sync_required" ]
}
initialize_or_update_repository() {
initialize_or_update_plugin_repository() {
local repository_url
local repository_path
@ -428,7 +428,7 @@ initialize_or_update_repository() {
exit 1
fi
repository_url=$(asdf_repository_url)
repository_url=$(asdf_plugin_repository_url)
repository_path=$(asdf_data_dir)/repository
if [ ! -d "$repository_path" ]; then
@ -436,7 +436,8 @@ initialize_or_update_repository() {
git clone "$repository_url" "$repository_path"
elif repository_needs_update; then
printf "updating plugin repository..."
(cd "$repository_path" && git fetch && git reset --hard origin/master)
git -C "$repository_path" fetch
git -C "$repository_path" reset --hard origin/master
fi
mkdir -p "$(asdf_data_dir)/tmp"