forked from vieter-v/vieter
feat(server): added routes for removing arch-repo & repo
This commit is contained in:
parent
6283cbea9c
commit
68b7e5e71e
4 changed files with 149 additions and 23 deletions
|
|
@ -66,3 +66,20 @@ pub fn (r &RepoGroupManager) remove_arch_repo(repo string, arch string) ?bool {
|
|||
|
||||
return true
|
||||
}
|
||||
|
||||
// remove_repo removes a repo & its packages.
|
||||
pub fn (r &RepoGroupManager) remove_repo(repo string) ?bool {
|
||||
repo_dir := os.join_path_single(r.repos_dir, repo)
|
||||
|
||||
// If the repository doesn't exist yet, the result is automatically false
|
||||
if !os.exists(repo_dir) {
|
||||
return false
|
||||
}
|
||||
|
||||
os.rmdir_all(repo_dir)?
|
||||
|
||||
pkg_dir := os.join_path_single(r.pkg_dir, repo)
|
||||
os.rmdir_all(pkg_dir)?
|
||||
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue