@@ -212,35 +212,25 @@ fn merge_manifests_if_exists(new_manifest: &mut Value, existing_path: &PathBuf)
212
212
}
213
213
214
214
fn restart_stream_deck ( ) -> Result < ( ) > {
215
- if !cfg ! ( target_os = "macos" ) && !cfg ! ( target_os = "windows" ) {
216
- warn ! ( "Ignoring restart flag, since the OS is not Windows or macOS" ) ;
215
+ if !cfg ! ( target_os = "macos" ) {
216
+ warn ! (
217
+ "The --restart flag is currently only supported on macOS. \
218
+ See https://github.com/walfie/streamdeck-youtube-emotes/issues/1"
219
+ ) ;
217
220
return Ok ( ( ) ) ;
218
221
}
219
222
220
223
info ! ( "Restarting Stream Deck application" ) ;
221
224
222
- let stop_result = if cfg ! ( target_os = "macos" ) {
223
- Command :: new ( "pkill" ) . arg ( "Stream Deck" ) . status ( )
224
- } else {
225
- Command :: new ( "taskkill" )
226
- . args ( & [ "/f" , "/im" , "StreamDeck.exe" ] )
227
- . status ( )
228
- } ;
225
+ let stop_result = Command :: new ( "pkill" ) . arg ( "Stream Deck" ) . status ( ) ;
229
226
230
227
if let Err ( e) = stop_result {
231
228
warn ! ( error = %e, "Failed to stop Stream Deck" ) ;
232
229
}
233
230
234
- let start_result = if cfg ! ( target_os = "macos" ) {
235
- Command :: new ( "open" )
236
- . arg ( "/Applications/Stream Deck.app" )
237
- . status ( )
238
- } else {
239
- // Wait a bit to ensure that the Stream Deck application has actually closed
240
- std:: thread:: sleep ( Duration :: from_secs ( 2 ) ) ;
241
-
242
- Command :: new ( r#"C:\Program Files\Elgato\StreamDeck\StreamDeck.exe"# ) . status ( )
243
- } ;
231
+ let start_result = Command :: new ( "open" )
232
+ . arg ( "/Applications/Stream Deck.app" )
233
+ . status ( ) ;
244
234
245
235
if let Err ( e) = start_result {
246
236
warn ! ( error = %e, "Failed to start Stream Deck" ) ;
0 commit comments