mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-11-30 12:20:15 +01:00
Fix webpush command
This commit is contained in:
parent
b2b9891a58
commit
69cf773834
2 changed files with 4 additions and 4 deletions
|
|
@ -44,16 +44,16 @@ func generateWebPushKeys(c *cli.Context) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if outputFIle := c.String("output-file"); outputFIle != "" {
|
if outputFile := c.String("output-file"); outputFile != "" {
|
||||||
contents := fmt.Sprintf(`---
|
contents := fmt.Sprintf(`---
|
||||||
web-push-public-key: %s
|
web-push-public-key: %s
|
||||||
web-push-private-key: %s
|
web-push-private-key: %s
|
||||||
`, publicKey, privateKey)
|
`, publicKey, privateKey)
|
||||||
err = os.WriteFile(outputFIle, []byte(contents), 0660)
|
err = os.WriteFile(outputFile, []byte(contents), 0660)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
_, err = fmt.Fprintf(c.App.ErrWriter, `Web Push keys written to %s.`, outputFIle)
|
_, err = fmt.Fprintf(c.App.ErrWriter, "Web Push keys written to %s.\n", outputFile)
|
||||||
} else {
|
} else {
|
||||||
_, err = fmt.Fprintf(c.App.ErrWriter, `Web Push keys generated. Add the following lines to your config file:
|
_, err = fmt.Fprintf(c.App.ErrWriter, `Web Push keys generated. Add the following lines to your config file:
|
||||||
|
|
||||||
|
|
|
||||||
2
main.go
2
main.go
|
|
@ -23,7 +23,7 @@ If you want to chat, simply join the Discord server (https://discord.gg/cT7ECsZj
|
||||||
the Matrix room (https://matrix.to/#/#ntfy:matrix.org).
|
the Matrix room (https://matrix.to/#/#ntfy:matrix.org).
|
||||||
|
|
||||||
ntfy %s (%s), runtime %s, built at %s
|
ntfy %s (%s), runtime %s, built at %s
|
||||||
Copyright (C) Philipp C. Heckel, licensed under Apache License 2.0 & GPLv2
|
Copyright (C) Philipp C. Heckel, licensed under Apache License 2.0 & GPLv2
|
||||||
`, version, commit[:7], runtime.Version(), date)
|
`, version, commit[:7], runtime.Version(), date)
|
||||||
|
|
||||||
app := cmd.New()
|
app := cmd.New()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue