Sha256: e3e12d39f089b63644196f80ac49db405e2693ac5c6ddda785bf478065b593e5

Contents?: true

Size: 451 Bytes

Versions: 3

Compression:

Stored size: 451 Bytes

Contents

#!/usr/bin/env ruby

require 'sm'

URL = ENV['SLACK_WEBHOOK_URL']

channel = ARGV.shift
content = ARGV.empty? ? ARGF.read : StringIO.new(ARGV.join("\n")).read
exit 0 if content.empty?

username   = ENV['SLACKBOT_USERNAME'] || 'slackbot'
icon_emoji = ENV['SLACK_MSG_ICON_EMOJI'] || ':ghost:'

begin
  Sm.psm(channel, content, username, icon_emoji, URL)
rescue Sm::Error => e
  puts "Error posting to slack #{e.message}:\n#{e.backtrace.join("\n")}"
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sm-2.0.0 exe/slack-msg
sm-1.0.0 exe/post-slack-msg
sm-0.2.1 exe/post-slack-msg