aps/altools/repo
2021-08-25 12:21:03 +02:00

18 lines
464 B
Bash
Executable file

#!/bin/sh
########################################
# Repo, a repository manager for alnux #
########################################
case $1 in
# add a repo
add) git clone https://${3}/${2}.git /var/aps/repos/${2}
echo "${2}" >> /etc/al/repo.conf
;;
# update a repo
update) pushd && cd /var/aps/repos/${2} && git pull && popd ;;
# destroy a repo (remove)
destroy) rm -rfv /var/aps/repos/${2}
sed -i "/^${2}/d" /etc/al/repo.conf
;;
esac