Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): support reading message from stdin #243

Merged
merged 4 commits into from May 21, 2022
Merged

feat(cli): support reading message from stdin #243

merged 4 commits into from May 21, 2022

Conversation

piksel
Copy link
Member

@piksel piksel commented May 21, 2022

Allows piping the message to shoutrrr CLI:

$ some_command | shoutrrr slack://xoxb:123456789012-1234567890123-4mt0t4l1YL3g1T5L4cK70k3N@C0123456789 -

When the SHOUTRRR_URL environment variable has been set, you can also just pipe directly to shoutrrr, as the default option is to read from stdin. The main reason not to do this for normal usage is to prevent confusion upon invoking the command without any arguments as it waits for input from the attached console.

$ export SHOUTRRR_URL="slack://xoxb:123456789012-1234567890123-4mt0t4l1YL3g1T5L4cK70k3N@C0123456789"
$ some_command | shoutrrr

@codecov
Copy link

codecov bot commented May 21, 2022

Codecov Report

Merging #243 (e8f7c86) into main (6dbcb12) will increase coverage by 0.47%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #243      +/-   ##
==========================================
+ Coverage   77.07%   77.55%   +0.47%     
==========================================
  Files          95       95              
  Lines        2844     2860      +16     
==========================================
+ Hits         2192     2218      +26     
+ Misses        473      469       -4     
+ Partials      179      173       -6     
Impacted Files Coverage Δ
pkg/util/partition_message.go 90.00% <100.00%> (-5.46%) ⬇️
pkg/services/slack/slack_json.go 100.00% <0.00%> (ø)
pkg/services/discord/discord_json.go 92.59% <0.00%> (+0.92%) ⬆️
pkg/services/discord/discord_config.go 88.23% <0.00%> (+5.88%) ⬆️
pkg/services/discord/discord.go 81.25% <0.00%> (+24.72%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6dbcb12...e8f7c86. Read the comment docs.

@piksel piksel merged commit bafa90a into main May 21, 2022
@piksel piksel deleted the feat/cli-stdin branch May 21, 2022 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant