Skip to content

Commit

Permalink
remove conflicting list file first if there is one
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfortner authored and theofficialgman committed Dec 28, 2023
1 parent 7bda6ac commit a96c478
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,9 @@ add_external_repo() { # add an external apt repo and its gpg key
fi

# check if .list file already exists
[ -f /etc/apt/sources.list.d/${reponame}.list ] && error "add_external_repo: /etc/apt/sources.list.d/${reponame}.list already exists."
if [ -f /etc/apt/sources.list.d/${reponame}.list ]; then
sudo rm -f /etc/apt/sources.list.d/${reponame}.list || error "add_external_repo: failed to remove conflicting .list file."
fi

# download gpg key from specified url
if [ -f /usr/share/keyrings/${reponame-keyring.gpg} ]; then
Expand Down

0 comments on commit a96c478

Please sign in to comment.