diff --git a/repo.sh b/repo.sh index 606477a..6a64e20 100755 --- a/repo.sh +++ b/repo.sh @@ -1,6 +1,6 @@ #!/bin/bash -CONFIG_DIR="${HOME}/.config/vur" +CONFIG_DIR="/voidpkg/vur" CONFIG_FILE="vur.conf" KEY_FILE="privkey.pem" KEY_PATH="${CONFIG_DIR}/${KEY_FILE}" @@ -19,15 +19,36 @@ get_void_pkgs(){ read vpkgs_location if [ -z "${vpkgs_location}" ];then - vpkgs_location="${HOME}/vur" + vpkgs_location="/voidpkg/void-packages" echo "Creating directory: ${vpkgs_location}" mkdir -p "${vpkgs_location}" git clone https://github.com/void-linux/void-packages.git "${vpkgs_location}" elif [ -n "${vpkgs_location}" ];then - echo "Creating directory: ${vpkgs_location}" - git clone https://github.com/void-linux/void-packages.git "${vpkgs_location}" + while true;do + echo -n "Use ssh? [y/N]: " + read use_ssh + if [ -z "${use_ssh}" ] || [ "${use_ssh}" = "n" ] || [ "${use_ssh}" = "N" ] ;then + echo "Creating directory: ${vpkgs_location}" + + git clone https://github.com/void-linux/void-packages.git "${vpkgs_location}" || exit 1 + break + + + elif [ "${use_ssh}" = "y" ] || [ "${use_ssh}" = "Y" ];then + + echo -n "Remote git username? (i.e github username): " + read git_user + + git clone git@github.com:"${git_user}"/void-packages.git "${vpkgs_location}" || exit 1 + break + + else + + echo "please enter y, n, or leave blank" + fi + done fi } @@ -51,7 +72,6 @@ gen_conf(){ echo "void_packages=${void_packages_location}/hostdir/binpkgs" >> "${CONFIG_DIR}/${CONFIG_FILE}" - echo "Provid enter the full path of your custom repository: " source "${CONFIG_DIR}/${CONFIG_FILE}" fi }