INNER CODE UNIT · Go
init
nicholas-fedor/watchtower · cmd/notify-upgrade.go:40
func init() {
rootCmd.AddCommand(&cobra.Command{
Use: "notify-upgrade",
Short: "Upgrade legacy notification configuration to shoutrrr URLs",
Long: "Converts legacy Watchtower notification settings into shoutrrr URL format and writes them to a temporary file.",
Run: runNotifyUpgrade,
Args: cobra.NoArgs, // Enforces no positional arguments for this command.
})
}
// runNotifyUpgrade executes the notify-upgrade command, handling errors gracefully.
// It wraps the main logic in runNotifyUpgradeE and logs any failures with the reconfigured logger.
func runNotifyUpgrade(cmd *cobra.Command, args []string) {
log := logging.New(os.Stderr, logging.InfoLevel)
log, err := runNotifyUpgradeE(cmd, args, log)
if err != nil {
log.Error().Err(err).Msg("Notification upgrade failed")