2 Commits

Author SHA1 Message Date
6399a20ed1 Updated zrep version to 0.0.6
- Updated version to 0.0.6
- Changed repo_url to https://zrep.kekepower.com
- Added reminder to copy 'zrep' to a directory in 'PATH'
- Added reminder to source ${zshrc_file} after installation.
2024-04-03 13:57:43 +02:00
2e0d42c040 Updated zrep version to 0.0.5
- Updated version to 0.0.5
- Added validation for package name format
- Display error message if package name format is incorrect
2024-04-02 21:57:39 +02:00

11
zrep
View File

@ -2,7 +2,7 @@
setopt extendedglob setopt extendedglob
VERSION="0.0.4" # Sun-2024-03-31 VERSION="0.0.6" # Wed-2024-04-03
ZREP="Zsh Repository Tool" ZREP="Zsh Repository Tool"
# Define the default path to .zreprc # Define the default path to .zreprc
ZREP_CONFIG="${HOME}/.zreprc" ZREP_CONFIG="${HOME}/.zreprc"
@ -174,7 +174,7 @@ function zrep_init() {
zrep_install_dir = ${install_dir} zrep_install_dir = ${install_dir}
[global] [global]
repo_url = https://kekepower.com/zrep repo_url = https://zrep.kekepower.com
theme = classic theme = classic
downloader = ${downloader} downloader = ${downloader}
EOF EOF
@ -232,6 +232,8 @@ EOF
zrep_global_downloader https://git.kekepower.com/kekePower/zrep/raw/branch/main/themes/classic -o ${install_dir}/themes/classic zrep_global_downloader https://git.kekepower.com/kekePower/zrep/raw/branch/main/themes/classic -o ${install_dir}/themes/classic
fi fi
echo "zrep initialization complete." echo "zrep initialization complete."
echo "You should copy 'zrep' to a path in you 'PATH' so that it's accessible."
echo "For example '${HOME}/bin'"
echo "Remember to 'source ${zshrc_file}' to load the 'zrep' settings." echo "Remember to 'source ${zshrc_file}' to load the 'zrep' settings."
} }
@ -646,6 +648,11 @@ function zrep_install_package() {
else else
updates=false updates=false
local package="${1}" local package="${1}"
# Ensure package name is in 'author/package' format
if [[ ! "${package}" =~ ^.+/[^/]+$ ]]; then
zrep_msg debug "\nError: Package name must be in 'author/package' format."
return 1
fi
# Call zrep_check_if_installed to check if the package is already installed # Call zrep_check_if_installed to check if the package is already installed
if zrep_check_if_installed "${package}"; then if zrep_check_if_installed "${package}"; then
zrep_msg debug "\nPackage ${package} is already installed." zrep_msg debug "\nPackage ${package} is already installed."