diff --git a/zrep b/zrep index b4e7447..49ff109 100755 --- a/zrep +++ b/zrep @@ -157,6 +157,7 @@ function zrep_init() { # Prompt user for install directory read "install_dir?Enter zrep installation directory [${HOME}/.zrep]: " install_dir=${install_dir:-"${HOME}/.zrep"} + mkdir -p ${install_dir} read "downloader?Choose command to download packages [curl, wget, wget2]: " if [[ ${downloader} != curl && ${downloader} != wget && ${downloader} != wget2 ]]; then echo "Invalid choice: '$downloader'. Try again." @@ -191,6 +192,7 @@ EOF curl -s https://raw.githubusercontent.com/kekePower/zini/main/zini -o "${install_dir}/functions/zini/zini" echo "Adding 'zini' path to fpath in ${zshrc_file}" echo "fpath=(${install_dir}/functions/zini \$fpath)" >> ${zshrc_file} + autoload -Uz zini fi # Check if .zshrc already sources .zrep_addons, if not, add it @@ -202,6 +204,7 @@ EOF # Create or update the .zrep_addons file if [[ ! -f ${zrep_addons} ]]; then echo "Creating file ${zrep_addons}..." + touch ${install_dir}/.addons cat > "${zrep_addons}" <