Merge 06e146ccbe405d6c4d3fbdfd77f0c95d954cf958 into eaaa2e5872ef9e845a50c6aade36676c0ecfe2e2

This commit is contained in:
Aziz Rmadi 2024-10-22 17:19:17 -04:00 committed by GitHub
commit 8fb9435fb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,7 +61,8 @@ func cmdAddPackage(fl Flags) (int, error) {
for _, arg := range fl.Args() {
if _, ok := pluginPkgs[arg]; ok {
return caddy.ExitCodeFailedStartup, fmt.Errorf("package is already added")
fmt.Printf("[WARNING] package %s is already added", arg)
continue
}
pluginPkgs[arg] = struct{}{}
}
@ -85,7 +86,8 @@ func cmdRemovePackage(fl Flags) (int, error) {
for _, arg := range fl.Args() {
if _, ok := pluginPkgs[arg]; !ok {
// package does not exist
return caddy.ExitCodeFailedStartup, fmt.Errorf("package is not added")
fmt.Printf("[WARNING] package %s is not added", arg)
continue
}
delete(pluginPkgs, arg)
}