-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We need to close the tray app and remove it before the new version can be installed. If the app was running we restart the app. Signed-off-by: Jon Morrow <jmorrow@chef.io>
- Loading branch information
Jon Morrow
committed
Oct 16, 2018
1 parent
b743003
commit 4c86960
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
restart_required=false | ||
# Close the app if it is running. | ||
if [ $(osascript -e 'application "Chef Workstation App" is running') = 'true' ]; then | ||
restart_required=true | ||
echo "Closing Chef Workstation App..." | ||
osascript -e 'quit app "Chef Workstation App"' > /dev/null 2>&1; | ||
fi | ||
|
||
# Restart the app if it was running. | ||
if $restart_required; then | ||
echo "Restarting Chef Workstation App..." | ||
osascript -e 'open app "Chef Workstation App"' > /dev/null 2>&1; | ||
fi |