@@ -44,45 +44,6 @@ auto_venv_update_check() {
44
44
# Call the update check function when the plugin loads
45
45
auto_venv_update_check
46
46
47
- # Plugin update check function
48
- auto_venv_update_check () {
49
- local remote_tag local_tag repo_path user_input
50
- repo_path=" ${ZSH_CUSTOM:- ~/ .oh-my-zsh/ custom} /plugins/auto-venv"
51
-
52
- # Ensure git is available
53
- if ! command -v git & > /dev/null; then
54
- echo " Git is not installed. Cannot check for plugin updates."
55
- return
56
- fi
57
-
58
- # Fetch the latest tags from the remote
59
- git -C " $repo_path " fetch --tags
60
-
61
- # Get the latest tag name from the remote and local
62
- remote_tag=$( git -C " $repo_path " describe --tags ` git -C " $repo_path " rev-list --tags --max-count=1` )
63
- local_tag=$( git -C " $repo_path " describe --tags)
64
-
65
- # Check if the latest tag matches the currently checked-out version
66
- if [ " $remote_tag " != " $local_tag " ]; then
67
- echo " New version available for auto-venv: $remote_tag (current version: $local_tag )"
68
- echo -n " Do you want to update the plugin now? [Y/n] "
69
- read user_input
70
-
71
- if [[ " $user_input " = " Y" || " $user_input " = " y" || " $user_input " = " " ]]; then
72
- echo " Updating auto-venv plugin from $local_tag to $remote_tag ..."
73
- git -C " $repo_path " checkout " $remote_tag "
74
- else
75
- echo " Update aborted. You can manually update later by running:"
76
- echo " git -C $repo_path checkout $remote_tag "
77
- fi
78
- else
79
- echo " auto-venv plugin is up to date."
80
- fi
81
- }
82
-
83
- # Call the update check function when the plugin loads
84
- auto_venv_update_check
85
-
86
47
# autoload is used to load the add-zsh-hook function.
87
48
autoload -U add-zsh-hook
88
49
0 commit comments