File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,9 @@ module Sentry
145
145
property display_name : String
146
146
property should_build = true
147
147
property files = [] of String
148
+ @sound_player : String = " "
149
+ @success_wav = " #{ __DIR__ } /sounds/drip.wav"
150
+ @error_wav = " #{ __DIR__ } /sounds/error.wav"
148
151
149
152
def initialize (
150
153
@display_name : String ,
@@ -163,6 +166,14 @@ module Sentry
163
166
@app_built = false
164
167
@should_install_shards = install_shards
165
168
@colorize = colorize
169
+
170
+ if File .exists?(@success_wav ) && File .exists?(@error_wav )
171
+ {% if flag?(:linux ) % }
172
+ @sound_player = ` which aplay 2>/dev/null` .chomp
173
+ {% elsif flag(:darwin ) % }
174
+ @sound_player = ` which afplay 2>/dev/null` .chomp
175
+ {% end % }
176
+ end
166
177
end
167
178
168
179
private def stdout (str : String )
@@ -214,9 +225,13 @@ module Sentry
214
225
if build_result && build_result.success?
215
226
@app_built = true
216
227
create_app_process()
228
+ ` #{ @sound_player } #{ @success_wav } 2>/dev/null` unless @sound_player .blank?
217
229
elsif ! @app_built # if build fails on first time compiling, then exit
218
230
stdout " 🤖 Compile time errors detected. SentryBot shutting down..."
231
+ ` #{ @sound_player } #{ @error_wav } 2>/dev/null` unless @sound_player .blank?
219
232
exit 1
233
+ else
234
+ ` #{ @sound_player } #{ @error_wav } 2>/dev/null` unless @sound_player .blank?
220
235
end
221
236
end
222
237
You can’t perform that action at this time.
0 commit comments