From f9c5c5ad60bc4b0779fb6094878527e9a065453a Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 14 Jan 2018 11:12:28 -0800 Subject: [PATCH] Fix logic in SendToMarsEditCommand where it finds the app to talk to. A running app takes precedence. --- Commands/SendToMarsEditCommand.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Commands/SendToMarsEditCommand.swift b/Commands/SendToMarsEditCommand.swift index ea6b8be83..aded2f4e9 100644 --- a/Commands/SendToMarsEditCommand.swift +++ b/Commands/SendToMarsEditCommand.swift @@ -39,11 +39,15 @@ private extension SendToMarsEditCommand { func appToUse() -> UserApp? { + marsEditApps.forEach{ $0.updateStatus() } + for app in marsEditApps { - app.updateStatus() if app.isRunning { return app } + } + + for app in marsEditApps { if app.existsOnDisk { return app }