diff --git a/.circleci/config.yml b/.circleci/config.yml index 3fb1d5d..88fbcd3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,7 @@ jobs: environment: TEST_RES_DIR: /tmp/test-results ARTIFACTS_DIR: /tmp/artifacts - APP_VERSION: v0.4.1 + APP_VERSION: v0.5.0 steps: - checkout - run: diff --git a/applescriptHandler.go b/applescriptHandler.go index 6f35863..c3a0e35 100644 --- a/applescriptHandler.go +++ b/applescriptHandler.go @@ -31,10 +31,14 @@ end tell func CloseApp(appName string, reschan chan string, errchan chan error) func() { return func() { script := fmt.Sprintf(` -tell application "%s" - quit -end tell - `, appName) +if exists application "%s" then + tell application "%s" + quit + end tell +else + error "could not close app '%s, because it cannot be found" +end if + `, appName, appName, appName) err := executeAppleScript(script)