Update zrep logo in README.md

Enhance version string color in zrep script
Add bold style to version number in zrep script
Fix autoload command in zrep script
Improve color styling for active/inactive packages in zrep script
This commit is contained in:
Stig-Ørjan Smelror 2024-03-10 09:49:34 +01:00
parent cb15f80042
commit 2ebb0fd3b7
3 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,5 @@
<img src="zrep-logo.svg" width="150" align="left">
# Zsh Repository Tool (zrep) # Zsh Repository Tool (zrep)
zrep is a powerful and user-friendly package manager for the Zsh shell. It allows you to easily install, manage, and share Zsh packages, such as plugins, themes, and scripts, directly from a central repository. zrep is a powerful and user-friendly package manager for the Zsh shell. It allows you to easily install, manage, and share Zsh packages, such as plugins, themes, and scripts, directly from a central repository.
@ -26,4 +28,4 @@ zrep is an open-source project, and contributions are welcome! If you have any i
## License ## License
zrep is released under the MIT License. zrep is released under the MIT License.

7
zrep
View File

@ -60,7 +60,7 @@ colors=(
) )
function zrep_main_version_string() { function zrep_main_version_string() {
echo "${colors[bold_black]}${colors[white_bg]} ${ZREP} ${colors[end]}${colors[white]}${colors[black_bg]} ${VERSION} ${colors[end]}" echo "${colors[bold_black]}${colors[white_bg]} ${ZREP} ${colors[end]}${colors[bold_white]}${colors[black_bg]} ${VERSION} ${colors[end]}"
} }
function zrep_version() { function zrep_version() {
@ -128,6 +128,7 @@ if [[ -n \${addons[@]} ]]; then
fpath=(\$addon "\${fpath[@]}") # Prepend the new addon to fpath fpath=(\$addon "\${fpath[@]}") # Prepend the new addon to fpath
fi fi
done done
autoload -Uz $(basename ${addon})
else else
echo "zrep: No addons enabled." echo "zrep: No addons enabled."
fi fi
@ -203,14 +204,14 @@ function zrep_list_installed_packages() {
# Iterate through each author and their packages # Iterate through each author and their packages
jq -r 'to_entries | .[] | .key as $author | .value[] | "\($author)/\(.script) (\(.version))"' "$installed_json" | while IFS= read -r package_info; do jq -r 'to_entries | .[] | .key as $author | .value[] | "\($author)/\(.script) (\(.version))"' "$installed_json" | while IFS= read -r package_info; do
local package_name=$(echo "$package_info" | cut -d ' ' -f1) # Extract package name before the version local package_name=$(echo "$package_info" | cut -d ' ' -f1) # Extract package name before the version
local is_active="${colors[white]}(${colors[end]}${colors[red]}Inactive${colors[end]}${colors[white]})${colors[end]}" # Set default to Inactive local is_active="${colors[white]}(${colors[end]}${colors[bold_red]}Inactive${colors[end]}${colors[white]})${colors[end]}" # Set default to Inactive
# Check if the package is active (only modify if active) # Check if the package is active (only modify if active)
if grep -q "$package_name" ${config[main_zrep_install_dir]}/.addons; then if grep -q "$package_name" ${config[main_zrep_install_dir]}/.addons; then
is_active="${colors[white]}(${colors[end]}${colors[bold_green]}Active${colors[end]}${colors[white]})${colors[end]}" is_active="${colors[white]}(${colors[end]}${colors[bold_green]}Active${colors[end]}${colors[white]})${colors[end]}"
fi fi
zrep_msg other " - $package_info $is_active" zrep_msg info " - $package_info $is_active"
done done
} }

1
zrep-logo.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.1 MiB